When a person's lungs fail to function as they should, a person is put on a breathing machine called a ventilator that mimics respiration, maintaining adequate levels of oxygen in the blood.