An effective approach on zero-voltage switching scheme for a single-stage grid-connected flyback inverter along with the introduction of Modified Grey Wolf Optimizer technique based on the proportional integral controller is proposed. A focus on soft-switching is attained by means of permitting the grid-side negative current along the bidirectional switches held in the transformer’s secondary side. Consequently, there is a discharge of metal–oxide–semiconductor field-effect transistor’s output capacitor. This function led the primary switch to turn ON at the condition of zero voltage. Therefore, it is essential to optimize the reactive current level for attaining zero-voltage switching. Generally, the basic Grey Wolf Optimization has some more disadvantages of accuracy-solving and less capability of finding the fitness solutions. Hence, to overcome this, optimizer can be modified for further enhancement in the optimization process. Modified Grey Wolf Optimizer based on the proportional integral controller with pulse width modulation technique is used for controlling the switches; thereby zero-voltage switching triggering takes place which results in decreased total harmonic distortion. Finally, the simulations can be carried out based on the total harmonic distortion which helps to illustrate the effectiveness of the suggested algorithm. A 24-V, 325-W prototype has been carried out to verify the proposed system.