Carbon quantum dots (CQDs) from heat-treated foods show toxicity, but the mechanisms of toxicity and removal of CQDs have not been elucidated. In this study, CQDs were purified from roasted coffee beans through a process of concentration, dialysis and lyophilization. The physical properties of CQDs, the degree and mechanism of toxicity and the removal method were studied. Our results showed that the size of CQDs roasted for 5 min, 10 min and 20 min were about 5.69 ± 1.10 nm, 2.44 ± 1.08 nm and 1.58 ± 0.48 nm, respectively. The rate of apoptosis increased with increasing roasting time and concentration of CQDs. The longer the roasting time of coffee beans, the greater the toxicity of CQDs. However, the caspase inhibitor Z-VAD-FMK was not able to inhibit CQDs-induced apoptosis. Moreover, CQDs affected the pH value of lysosomes, causing the accumulation of RIPK1 and RIPK3 in lysosomes. Treatment of coffee beans with a pulsed electric field (PEF) significantly reduced the yield of CQDs. This indicates that CQDs induced lysosomal-dependent cell death and increased the rate of cell death through necroptosis. PEF is an effective way to remove CQDs from roasted coffee beans.