Photocatalytic splitting of water to produce hydrogen can solve energy shortages. However, the high rate of electron–hole pair recombination triggered by light absorption poses a considerable challenge to the efficacy of single-component photocatalysts. The creation of van der Waals (vdW) heterojunctions has emerged as a highly effective strategy to mitigate the recombination of charge carriers. Therefore, first-principles computations were utilized to examine the stability, electronic characteristics, optical behavior, and photocatalytic mechanisms of the NiS2/WSe2 van der Waals (vdW) heterojunction. This heterojunction functions in the capacity of an indirect band gap semiconductor, exhibiting a band gap energy that has been determined to be 0.55 eV. It features a direct Z-scheme charge transfer mechanism, which has been shown to significantly enhance the separation of photocarriers (electrons and holes). Its valence band alignment fulfills the criteria for the redox of water over the full range of pH values. In comparison with monolayer materials, it exhibits a substantially augmented capacity for visible light absorption. Furthermore, it attains a noteworthy solar-to-hydrogen (STH) transformation efficiency of 14.93% during AM1.5G solar irradiation. Strain engineering further optimized its optical absorption and catalytic performance. The calculations of Gibbs free energy demonstrate that the NiS2/WSe2 heterojunction exhibits an efficient performance in oxygen and hydrogen evolution reactions (OER and HER), respectively. This study offers a material candidate with promising potential to be utilized in designing highly efficient photocatalytic systems.