Diagnosis typically involves a detailed medical history and physical examination. Sleep diaries and questionnaires can provide additional information. In some cases, a pediatrician may recommend a polysomnography (sleep study) to evaluate the child's sleep patterns more thoroughly. Specialized tests might be needed for specific conditions like restless legs syndrome.