One challenge in the field of photothermal therapy (PTT) is to design an assembly of carbon nanodots (CNDs) with enhanced light absorption in the near-infrared (NIR) spectral region and improved photothermal conversion efficiency. Herein, a type of CND assembly was fabricated using a covalent click reaction in a water-in-oil emulsion system (abbreviated as W/O assembly), providing excellent stability, controllable size distributions, enhanced NIR absorption, and improved applications in photothermal imaging (PTI), photoacoustic imaging (PAI), and PTT. A mechanism based on energy dissipation was proposed in detail to explain the changes in photophysical properties before and after CND assembly. In addition, an outstanding antibacterial effect was also observed during the in vitro phototherapy of drug-resistant pathogens. Importantly, the results of in vivo infection assays further verified satisfying photokilling effect toward drug-resistant bacteria and excellent biosafety to normal cells and tissues. Given the benefits of the covalent CND assembly developed in this work, it might have potential applications in the following aspects: (1) strategy of the controllable covalent assembly could be extended to other nanosystems and (2) in situ CND assembly could be built at disease sites based on microenvironment-triggered bioorthogonal click reactions, improving targeting performance and reducing the side effects of PTT.