It is the kidneys job to filter the blood and remove waste products.
The kidneys are made of functional units call nephrons of which there around a million per human kidney. In the renal corpuscle filrate containing sugars, water and salts are filtered out of the cappilaries into the nephron. Then in the proximal convuluted tubule the sugars and other nutrients are reabsorbed into the body. The loop of Henle is resposible for creating an osmotic gradient to reabsorb the majority of the water back into the blood. Then in the distal convuluted tubule further adjustments are made to perfect the balance of nutrients. Remaining filtrate leaves the kidneys via the ureter to enter the bladder, filtrate is now know as urine.