Continuous positive airway pressure (CPAP)—which uses a machine that pushes pressure into your airways to prevent their inward collapse—is the primary treatment for obstructive sleep apnea (OSA).