In order to gain the optimal performance of a controller, the proper selection of its parameters is of great importance. Moreover, any changes in the values of the parameters of the system cause that the respected controller works in a non-optimal status. Hence, to prevail over these obstacles, a state-varying optimal Decoupled Sliding Mode Control (DSMC) method is proposed in this research. First, the High Exploration Particle Swarm Optimization (HEPSO) approach is employed to find the optimal parameters of the DSMC. Then, the Moving Least Squares (MLS) approximation method is used to adjust the optimal gains of the controller according to the new parameters of the system. Lastly, the proposed state-varying optimal DSMC is utilized to address the Lorenz chaotic problem. The efficacy of the proposed controller is illustrated via comparing its performance with other notable studies.