According to a study that appeared in Proceedings of the National Academy of Sciences, people who go to bed depressed or with a sad feeling have higher levels of cortisol the following morning, the chief hormone released during stress.
An important thing you can infer from this study is that your emotional state during bedtime sustains throughout your sleep and prepares your body accordingly. So if you suffer from any sleep related disorder, it is most likely that your emotional state before and during bedtime is far from bliss and peace, due to worry over whether you’ll get a good night’s sleep or not. As a result, stress levels are usually higher in people affected with sleep problems, making the problem worse. It’s like a snow ball effect. Bad sleep -> bad mood -> more stress -> bad sleep -> so on…
So an important step you can take to reducing your stress levels and improving the quality of your sleep is to feel happy during bedtime.