A sleep study (polysomnography) is often used to diagnose sleep apnea by monitoring your sleep and breathing patterns.