Peritoneal dialysis may be used to treat kidney failure. This is when the kidneys can no longer remove waste products from the blood.