In the paper we prove strong consistency of statistical estimator being $\varepsilon_{n}$-optimal solution of an optimization problem. We provide statements about consistency of $M$-estimator in regression models with random and non-random design.