Understanding the various catalytic mechanisms of activated peroxymonosulfate (PMS) is crucial for designing high-efficiency metal-supported catalysts. Herein, Co, S, O co-doped carbon nitride (CoCN-x) was constructed. Density functional theory (DFT) calculations for CN doped with different elements revealed that CoCN-x exhibited improved PMS activation capabilities. Optimized CoCN-0.5 achieved a 95% removal rate of sulfamethoxazole (SMX) within 30 s, with a degradation rate constant of 2.92 min−1, which is 845.34 times higher than that of the original CN. Additionally, the activation mechanism of PMS was thoroughly investigated, revealing the presence of classical radicals such as OH, SO4− and O2− and non-radicals involving 1O2, CoO2+, and electron transfer. Potential SMX degradation pathways were also elucidated using DFT calculations, HPLC-MS, and 3D EEMs. This work provides new insights into the development of catalysts that effectively activate PMS through both radical and non-radical mechanisms.