What is the function of the kidneys in animals?

the function of a kidney in a animal is for the poo to build up, which then meens they die. (: