Hierarchical structure can significantly increase the reactive sites and provide advantages for heterojunction engineering in the field of photocatalysis. However, it is still a great challenge to realize efficient photocatalytic hydrogen production by controlling the band structure and constructing Z-scheme heterojunction system based on the hierarchical photocatalyst. In this paper, a CdS/Co9S8 Z-scheme heterojunction system was prepared by depositing CdS nanoparticles on nanoflower-structured Co9S8 hierarchical photocatalyst, which showed enhanced photocatalytic hydrogen production performance. The photocatalytic hydrogen production rate of the CdS/Co9S8 Z-scheme heterojunction system is 11.60 mmol g−1 h−1, which is 13.6 and 55.2 times that of CdS and Co9S8, respectively. The synergistic effect of the hierarchical structure and the Z-scheme heterojunction makes the photogenerated charge carriers quickly and efficiently transfer to the surface of the photocatalyst, which accelerates the photocatalytic hydrogen production process.