Due to resistance to common antibiotics, methicillin-resistant Staphylococcus aureus (MRSA) infections pose a significant threat to human health. In this study, we developed an injectable, adhesive, and biocompatible hydrogel with multiple functions. Specifically, carboxymethyl chitosan (CMCS) crosslinked with hyaluronic acid (HA) forms the primary framework of the hydrogel. Subsequently, polydopamine (PDA), 5,10,15,20-tetrakis (4-aminophenyl) porphyrin (TAPP), and L-arginine (L-Arg) are incorporated as a photothermal agent, photosensitizer, and nitric oxide (NO) donor, respectively, resulting in the CHDTA hydrogel. Under the combined irradiation of 660 nm and 808 nm near-infrared (NIR) light, the CHDTA hydrogel exhibits both photodynamic therapy (PDT) and photothermal therapy (PTT) effects. Simultaneously, L-Arg reacts with singlet oxygen (