There are two types of dialysis: hemodialysis and peritoneal dialysis. In hemodialysis, blood is passed through an artificial kidney (hemodialyzer) to clean it. Peritoneal dialysis uses a filtering process similar to hemodialysis, but the blood is cleaned inside the body rather than in a machine.
Hemodialysis is the most common method used to treat advanced and permanent kidney failure. During this process, blood is removed from the body and circulated through an extracorporeal fluid circuit (outside the body), then returned to the patient. The blood is cleaned in a hemodialyzer. The hemodialyzer contains a selectively permeable membrane, which is a filter that allows fluids and waste (uremic toxins) to pass through, but prevents the exchange of blood components, microorganisms and the "skeletons" of dead microorganisms (endotoxins). The fluid used to clean the blood (dialysate) flows in the opposite direction to the blood on the opposite side of the membrane, while waste and extra fluid are removed from the blood and end up in the dialysate by controlling diffusion, ultrafiltration and osmosis.
The clean blood is then returned to the body. Removing the harmful wastes and extra salt and fluids helps control blood pressure and keep the proper balance of chemicals like potassium and sodium in the body.