The use of semiconductor photocatalysts for the hydrogen evolution reaction shows good promise for effectively alleviating the existing energy shortage. Moreover, ternary metal sulfides also exhibit stronger photoresponse performance and suitable band structures, leading to good photocatalytic activity. However, carrier recombination easily occurs in ternary metal sulfides, negatively affecting their photocatalytic performance. In order to address the above issues, this study achieved limited improvement in the electron recombination problem of ternary sulfides through a dual strategy of constructing a heterogeneous structure to quickly export electrons and extracting electrons through the loading of a co catalyst. The combination of B doped TiO2 and nano flower shaped ZnIn2S4 photocatalyst effectively increases the catalytic active sites, widens the absorption band edges, and improves the efficiency of photo generated electron and hole separation. The loading of NiO as a cocatalyst increased the light absorption intensity, changed the direction of electron transfer enrichment, and provided hydrogen production sites. Compared to pure TiO2, which had a band gap of 2.37 eV, the band gap of the modified catalyst decreased to 2.27 eV. Moreover, the hydrogen evolution rate increased by 2.17 fold from 3.84 mmol/(g ⋅ h) to 8.33 mmol/(g ⋅ h). The separation and migration rates of electrons and holes were significantly enhanced, which promoted rapid charge transfer. Moreover, the modified catalyst achieved Rhodamine B (RhB) and Congo red photocatalytic degradation rates of 99.91 % and 97.98 % in 1 h under simulated sunlight irradiation.