Herein, for the first time, the wasted cockle shells were modified with nitrogen and sulfur-doped carbon dots after carbonization and used as a suitable bio-based sorbent for the extraction of two important antiemetic drugs named ondansetron and domperidone. The extraction and separation were performed based on vortex-assisted dispersive solid-phase microextraction and high-performance liquid chromatography, respectively. Various techniques such as Fourier-transform infrared, fluorescence, field emission scanning electron microscopy, thermogravimetric analysis, nitrogen adsorption-desorption analysis, X-ray powder diffraction, and energy-dispersive spectroscopy were used to characterize the chemical composition of prepared sorbent. After examining the factors affecting the extraction efficiency and access to the optimal points using the response surface methodology, the linearity was in the range of 5-350μg/L with acceptable coefficients of determination (R2 >0.993). The limits of detection and quantification were in the range of 1.5-2.3 and 4.9-7.1μg/L, respectively. In the end, the proposed method was applied for the quantitative determination of trace levels of target analytes from pharmaceutical tablets, serum, and urine samples. The recoveries were more than 95.2%, indicating the proposed method's excellent accuracy.