In this research, hydrophobic DESs were successfully prepared using components with hydrophobic and sulfydryl group, which were applied to develop a green and eco-friendly method to extract and detect the cadmium (Cd) in herbal medicine (HM). The basic properties of the DESs were studied, which showed good hydrophobicity, low density and sufficient absorption capacity. In extraction process, the extraction efficiency (EE) of Cd employing proposed process ranged from 89.12 %∼94.59 % and the maximal enrichment factor (EF) was 46.85. The DES based method demonstrated a good linear response in the range of 1 ∼ 50 µg·L-1 with a detection limit (LOD) of 0.29 μg L-1, which was detected by Inductively coupled plasma mass spectrometry (ICP-MS). Additionally, the accuracy of method (as recoveries %) was obtained with the recoveries ranging from 98.38 %∼105.48 %. The extraction process was also compared with microwave digestion (MD) method and showed basically equivalent effect with good propensity to enrichment. The mechanism was explored by DFT calculation to reveal the interaction of extraction process. The greenness of the proposed method was also evaluated using the Green Analytical Procedure Index (GAPI) and Analytical Eco-Scale (AES), which indicated excellent environmental protection. This study successfully prepared novel DESs and established an eco-friendly and effective analytical process integrating adsorption, collection, separation and detection for the detection of heavy metals in HM, and the DESs were contributed to the first three parts as a multifunctional role. The absorption mechanism related to the formation of molecular complexes in quantum chemistry perspective, which were attribute to the electrostatic attraction and H+ exchange between Cd and adsorbent. This method showed vast potential in heavy metal research involving complex matrices such as HM and its processed products, and the proposed process provides the way for a greener alternative for Cd extraction rather than conventional polluting processes.