In this study, we report a facile synthesis of a novel N, S, B, and O-codoped carbon nanosphere-armored Co9S8 nanoparticle composite (Co9S8@NSBOC) and its superior activation performance toward peroxymonosulfate (PMS) for methylene blue (MB) and ofloxacin degradation. The effects of various experimental parameters and the general applicability of the catalyst were investigated. Particularly, Co9S8@NSBOC exhibited high catalytic activity in a wide pH range of 3-12 and HPO42- exhibited a synergic catalytic effect with Co9S8@NSBOC in the degradation system.