Sleep apnea is diagnosed through a sleep study, or polysomnography, which can be conducted in a sleep center or at home using a portable monitoring device. This study tracks various body functions during sleep, including brain activity, eye movements, heart rate, blood oxygen levels, and breathing patterns. Based on the results, a healthcare provider can determine if sleep apnea is present and its severity.