Graphitic carbon nitride is a promising photocatalyst to address environmental issues and energy applications. Herein, we develop an efficient defect-containing functionalized system of 2D selenium doped g-C3N4 porous nanosheets via one pot with two-step temperature for the first time. During heat treatment, Se-infused g-C3N4 nanosheets loosen stacking and form thinner nanosheets, which could effectively shorten the electronic path of charge migration. The introduction of nitrogen vacancies creates a midgap energy state below the CB, which improves the light-harvesting efficiency. Moreover, the dual effect of N vacancy and Se doping provides a driving force for the dissociation of excitons and achieves an effective spatial charge separation. High specific surface area (104.1 m2/g), suitable bandgap (2.65 eV), and good photocurrent response (0.45 µA cm−2) help to enhance the photocatalytic efficiency of 1-SeCN remarkably. Henceforth, high photocatalytic H2 production rate of 5441 µmol g−1 h−1 and CO evolution rate of 31.5 µmol g−1 h−1 verifies the effective Se doping enhances the photocatalytic efficiency of g-C3N4. Furthermore, DFT calculations are consistent with experimental results and this facile engineering strategy provides a scalable way to develop a novel, efficient g-C3N4-based photocatalyst for H2 production and CO2 reduction.