The utilization of l-cysteine in hydrothermal synthesis allows for the manufacture of carbon dots (CDs) that are doped with heteroatoms including oxygen, nitrogen, and sulfur (N, S, O-doped CDs). CDs have a particle size ranging from 1 to 3 nm, with an average particle size of 2.5 nm. N, S, and O-doped CDs display a blue fluorescence emission at a wavelength of 425 nm. It shows a reliance on the specific excitation wavelength between 320 and 500 nm. It has a selective quenching effect specifically with copper (Cu2+) ions when exposed to interactions with heavy metal ions, as compared to other metal ions. The assay has a limit of detection (LOD) of 2 μM and exhibits a linear correlation within the concentration range of 10–33.3 μM. The fluorescence mechanism was elucidated by employing various analytical techniques, such as transmission electron microscopy (TEM), high-resolution TEM , UV–Vis spectroscopy, zeta potential analysis, and conductometry. An analysis of the data reveals that Cu2+ ions exhibit a strong attraction to the external surface of N, S, and O-doped CDs, leading to the formation of aggregates. N, S, and O-doped CDs can be also used as probes for electrochemical investigations utilizing cyclic voltammetry (CV), linear sweep voltammetry (LSV), chronoamperometry (CA), and electrochemical impedance spectroscopy (EIS) to produce Nyquist and Bode plots. The electrochemical results offer substantiation for the interaction between Cu2+ ions and N, S, and O-doped CDs. Zero-dimensional carbon nanomaterials, i.e. CDs, can improve the detection of heavy metals using optical and electrochemical methods.