Repairing infected bone defects is hindered by the presence of stubborn bacterial infections and inadequate osteogenic activity. The incorporation of harmful antibiotics not only fosters the emergence of multidrug‐resistant bacteria, but also diminishes the osteogenic properties of scaffold materials. In addition, it is essential to continuously monitor the degradation kinetics of scaffold materials at bone defect sites, yet the majority of bone repair materials lack imaging capability. To address these issues, this study reports for the first time the development of a single nanomaterial with triple functionality: efficient sonodynamic antibacterial activity, accelerated bone defect repair capability, and NIR imaging ability for visualized therapy of infected bone defects. Through rationally regulating the surface functional groups, the obtained multifunctional NIR carbon dots (NIR‐CD) exhibit p–n junction‐enhanced sonodynamic activity, narrow bandgap‐facilitated NIR imaging capability, and negative charge‐augmented osteogenic activity. The validation of NIR‐CDs antibacterial and osteogenic activities in vivo is conducted by constructing 3D injectable hydrogels encapsulated by NIR‐CDs (NIR‐CD/GelMA). The implantation of multifunctional NIR‐CD/GelMA hydrogel scaffolds in a model of MRSA‐infected craniotomy defects results in almost complete restoration of the infected bone defects after 60 days. These findings will provide traceable, renewable, repairable and antibacterial candidate biomaterials for bone tissue engineering.