As a promising anode for sodium-ion batteries (SIBs), cobalt sulfide ( CoS2) has attracted extensive attention due to its high theoretical capacity, easy preparation, and superior electrochemical activity. However, its intrinsic low conductivity and large volume expansion result in poor cycling ability. Herein, nitrogen-doped carbon-coated CoS2 nanoparticles (N–C@ CoS2) were prepared by a C3N4 soft-template-assisted method. Carbon coating improves the conductivity and prevents the aggregation of CoS2 nanoparticles. In addition, the C3N4 template provides a porous graphene-like structure as a conductive framework, affording a fast and constant transport path for electrons and void space for buffering the volume change of CoS2 nanoparticles. Benefitting from the superiorities, the Na-storage properties of the N–C@CoS2 electrode are remarkably boosted. The advanced anode delivers a long-term capacity of 376.27 mAh g− 1 at 0.1 A g− 1 after 500 cycles. This method can also apply to preparing other metal sulfide materials for SIBs and provides the relevant experimental basis for the further development of energy storage materials.