The dispersion stability of nanomaterials in lubricants significantly influences tribological performance, yet their addition as lubricant additives often presents challenges in secondary dispersion. Here, we present a straightforward method for in situ preparation of N,S-codoped CDs (N,S-CDs)-based lubricants using heterocyclic aromatic hydrocarbons containing N/ S elements in poly(ethylene glycol) (PEG) base oil by a directional ultrasound strategy. Two types of N,S-CDs were successfully prepared via the directional ultrasound treatment of PEG with benzothiazole (BTA) and benzothiadiazole (BTH) separately. The resultant N,S-CDs have a uniform distribution of N and S elements and maintain good colloidal dispersion stability in PEG even after 9 months of storage. The N,S-CDs can enter the surface gap of the friction pairs and then induce a tribochemical reaction. Benefiting from the synergistic effect of N and S activating elements, a robust and stable protective film consisting of iron sulfides, iron oxides, carbon nitrides, and amorphous carbonaceous compounds is formed, thus endowing N,S-CDs-based lubricants with improved antiwear and friction-reducing performance. Compared with pure PEG, the coefficient of friction (COF) of the N,S-CDs(BTH)-based lubricant decreased to 0.108 from 0.292, accompanied by a 91.2% reduction in wear volume, and the maximum load carrying capacity increased to 450 from 150 N.