Dialysis is a medical procedure that performs the function of the kidneys in individuals who have lost kidney function due to illness or injury. It involves using a machine to filter waste products, excess fluids and impurities from the blood, similar to how healthy kidneys would do it naturally. The process can be done either externally (hemodialysis) where an artificial membrane is used to separate the blood from the dialyzing solution or internally (peritoneal dialysis) by using the lining of the abdomen as a natural filter for the blood. Dialysis helps to remove excess substances, maintain proper electrolyte balance and restore kidney function in patients with end-stage renal disease until they can receive a transplant or recover their own kidney function.