Effective application of the maximum principle in the case of singular controls and sliding regimes is considered. It is shown that the approach based on regularization of the functional being maximized, by adding a small quadratic term, makes it possible to avoid singular controls in optimal control problems.