The photovoltaic hydrogen production system has the potential for broad applications by directly converting light energy into hydrogen energy. However, the stability and efficiency of the system are negatively impacted by photovoltaic panels output fluctuations and proton exchange membrane electrolysis cell (PEMEC) load variations. To address these issues, this paper first proposes a sliding model control strategy for the buck converter in the photovoltaic hydrogen production system. Then, the basic principle and composition structure of the photovoltaic hydrogen production system are introduced. Finally, the precise control of the output voltage and current of the circuit is realized by establishing the mathematical model of the system and the design of the slide-mode controller. Simulation verification demonstrates that the control strategy effectively improves the system's stability and efficiency, thereby providing practical significance and reference value.