The main purpose of the kidneys is to make urine. Urine is made when the kidneys filter harmful chemicals, called toxins, out of the blood. The kidneys also help keep necessary chemical substances in the blood, such as sodium, proteins, and sugars.