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