To remove heavy metals from wastewater, coal gasification slag (CGS) was prepared as an adsorbent. Five modified materials were created, including HF‐CGSC, KOH‐HCl‐CGS, and three KOH‐CGS variants with different mass ratios. The adsorption tests showed KOH‐CGS (0.25) had the best efficiency for Pb(II) and Cd(II) via spontaneous chemisorption. Kinetic, thermodynamic, and 13C NMR analyses indicated that adsorption involved pore adsorption, functional group coordination, and π‐π interactions. Competitive adsorption results showed minimal interaction between Pb and Cd. Leaching tests confirmed the process's environmental safety. This study suggests new approaches for using coal gasification slag in wastewater treatment.