Although sample preparation, as an unavoidable step of the analytical process should be simple, it is very often identified as a bottleneck. Simplicity of sample preparation based on cost-effective and non-hazardous materials is mandatory for any sustainable and environmental friendly approach. Aqueous biphasic systems (ABS), based on functionalized ionic liquids (FILs) are acceptable alternatives to classical extraction procedures, due to the replacement of organic solvent with diluted aqueous-soluble ionic liquids. In this work, two water soluble FILs based on 2-mercaptobenzothiazolate anion, [mbt]: 1-butyl-3-methylimidazolium [mbt] ([bmim][mbt]) and 1-ethyl-3-methylimidazolium [mbt] ([emim][mbt]), were designed and synthesized in order to selectively extract Cd(II) and Pb(II) from the river sediment. It was found that [mbt]– anion acts as the ligand and forms complexes with Cd(II) and Pb(II) which are responsible for their efficient extraction, while cation is more responsible for the formation of ABS. Partition coefficients of 408 and 180 for Cd(II) and Pb(II), respectively, were obtained using ABS based on [bmim][mbt]. Direct extraction of Cd(II) and Pb(II) from the river sediment has been investigated and obtained optimal conditions are: 60 min direct contact of the aqueous solution of [bmim][mbt] and the sediment sample at 90 °C, followed by formation of ABS upon addition of potassium citrate. Using AGRE and AGREEprep tools greenness of the proposed method for direct extraction of Cd(II) and Pb(II) from the sediment are calculated. Obtained values of 0.69 and 0.71 for Cd(II) and Pb(II) extraction, respectively, showed a high level of the greenness of the proposed method.