An in situ electrochemical method is proposed to integrate FeSe/FeS heterostructures into a 3D S-doped carbon framework, enhancing sodium storage capacity and kinetics. Concurrently, both in situ and ex situ techniques are employed to investigate the underlying mechanisms.