There are two types of dialysis: hemodialysis and peritoneal dialysis. With hemodialysis, your blood is passed through an artificial kidney machine which cleans it. Peritoneal dialysis uses a filtration process similar to hemodialysis, but the blood is cleaned inside your body rather than in a machine.
Blood is circulated through a machine which contains a dialyzer (also called an artificial kidney). The dialyzer is separated by a membrane into two spaces. One one side passes blood, the other side dialysis fluid. Waste and excess water pass from the blood through the membrane into the dialysis fluid and then discarded. The cleaned blood is returned to the bloodstream.