Dialysis is the most common treatment for patients with advanced kidney failure. The function of dialysis is to help your body by filtering out waste and excess fluid the way your kidneys would if they were working properly. There are two common types of dialysis: peritoneal dialysis and hemodialysis.