A CPAP (Continuous Positive Airway Pressure) machine is used to provide a constant flow of air through a mask to keep the airways open during sleep. It is primarily used to treat obstructive sleep apnea, helping improve breathing, reduce snoring, and promote better sleep quality.