This paper discusses a detailed model and control of an H-bridge voltage source inverter (VSI) topology-based Distribution Static Compensator (DSTATCOM) for total harmonic distortion analysis in three-phase nonlinear loads. The paper emphasizes the efficiency of multilevel inverter structures in improving power quality and controlling voltage sags, while also addressing the complexities of their control systems. Simulation results using MATLAB/Simulink demonstrate the effectiveness of the proposed DSTATCOM in mitigating harmonics and enhancing power factor compared to systems without it.