Obtaining highly active and selective target products is both promising and challenging, and can be achieved by regulating the adsorption and desorption energy of reaction intermediates, as well as the transfer of electrons under visible light. Herein, an efficient CNGA/CdS photocatalyst based on ultrathin porous nitrogen vacancies carbon nitride (CNGA) nanosheets (thickness <1 nm) with CdS nanoparticles was synthesized by a facile route for visible-light photocatalytic CO2 reduction. As a result, the rate of CO production was 32.75 μmol g−1 h−1, which was 17.24 and 32.75 times that of CN and CdS under visible light (λ ≥ 420 nm) without sacrificial agents and cocatalysts. Importantly, introducing CdS nanoparticles into CNGA could improve the selectivity of CO2 to CO by nearly 100% (yield-based selectivity). Finally, the photocatalytic mechanism was explored by in-situ FTIR spectra and DFT calculations, and the results presented that the formation of heterostructures facilitated the generated *CO groups to modulate the reaction pathway of photocatalytic CO2 reduction. This work is expected provide a reference for the design of photocatalysts for photoreduction CO2 with accurate products under visible light.