Dialysis is a medical procedure that performs the function of the kidneys in removing waste products and excess fluids from the blood. It is a critical treatment for patients with kidney failure or severe kidney dysfunction. There are two main types of dialysis: hemodialysis and peritoneal dialysis.