Although single-atom catalysts are pioneers in peroxymonosulfate (PMS) activation, selection of substrates and enhanced binding remains ambiguous. Here, a novel highly dispersed cobalt single-atom loaded 2-methylimidazole (MeIm) ligand-modified carbon nitride catalyst (Co-MCAMeIm) was prepared by a molecular self-assembly strategy. The densely distributed SA-Co with Co-N sites were corroborated by HAADF-STEM and XAFS analysis. The strong chelation of pre-dispersed ligands and triazine ring of g-C3N4 confers higher stability to the catalyst, reducing Co leaching. Meanwhile, the g-C3N4 substrate offers additional adsorption sites to shorten the reaction distance. The embedded Co-N functions as an electron donor capable of bridging N-rich carbon networks, hence accelerating the electron transport. Experimental findings demonstrated that sulfamethoxazole (SMX) could be effectively cleared through Co-MCAMeIm/PMS process (99.1%, 0.13 min−1). Several key influencing factors like Co to MeIm molar ratio, PMS concentration, Co-MCAMeIm dosage, pH value, anions, and humic acid were examined. The catalytic pathway is dominated by the activation of PMS with SA-Co-N as active sites to form 1O2. Meanwhile, a multi-ROS process with occurrence of SO4•-, O2•- and •OH was confirmed. Additionally, the SMX degradation routes and toxicity variations were derived and analyzed. Herein, the research may provide new insights for stable single-atom catalyst towards water treatment.