Find out whether you're in shape for a good night's sleep by testing your melatonin and cortisol levels. Melatonin helps regulate the body's internal clock and is needed for deep sleep, but high evening cortisol levels inhibit melatonin production.