The glomerulus of the kidney filters out any toxins, excreting them as urine. Then you have passive diffusion of any necessary ions back into circulation.
The nephrons in kidneys absorb waste products including toxins and excrete them out of the body as urine
Imagine you've got rotting produce in the fridge. Your kidney removes EVERYTHING from the fridge, then puts the good stuff back. Nephrons complete this process using urea to promote filtration while fluid is moving through the loop of henle, shortly after the glomerulus