Respiratory failure occurs when the respiratory system fails to adequately oxygenate the blood or remove carbon dioxide due to diseases of the lungs, heart, chest wall or neuromuscular system. It is classified as hypoxemic, with low blood oxygen, or hypercapnic, with high blood carbon dioxide. Common causes include pneumonia, pulmonary edema, lung injury and reduced respiratory drive from drug overdose or brain injury. Treatment focuses on oxygen therapy, secretion clearance, ventilation support, treating underlying conditions and preventing further organ damage.