I honestly think (for me, at least) the implied causation is the wrong way round here. When I'm feeling sad, I tend to be unmotivated and liable to spend more time / all day on my phone. When I'm feeling great, I'm generally motivated to go outside / do DIY / read / have a lot less screen time. I initially spent lots of effort trying to reduce my screen time (parental controls, etc) before realising that it was proba…
* Lack of sleep lowers my energy and creative function. I no longer have energy to try new things, or to think out-of-the-box. The brain enters "survival mode" of just following the routine to make it to the end of day. If I let this accumulate over multiple days, the overall motivation and happiness starts dropping exponentially. This makes sense, since a lot of my happiness comes from envisioning goals and achieving them, which I cannot do if I don't sleep enough.
* If I get more than 1 night of bad sleep, I usually try to squeeze in a strenuous hike or just go cycling around the neighborhood. At least 1-2 hours, ideally 4-5. It increases the physical tiredness and makes it easier to fall asleep. It also fills in the short-term memory buffer with random stuff, that seems to have a positive correlation with subsequent sleep quality.
* Screen time generally depends on what you are doing. Routine work or clickbait browsing is bad because it doesn't make you tired and doesn't give enough short-term impressions. Playing games can give impressions, but they also raise excitement, that makes it harder to fall asleep. What works for me is to read for 30-60 minutes just before bedtime. Classic books, sci-fi, anything that is not exciting, but involves imagining what I just read about. After I'm done reading, I make a conscious effort to NOT think about work/plans/stressful topics. Thinking about what I just read usually works pretty well.
* You need to be very careful with alcohol. Moderate amount (say, 1-2 beers) makes it easier to fall asleep, but there's a high chance of waking up after 2-3 hours once it wears off. It also seems to recalibrate the nervous system, making it harder to fall asleep without drinking. So if you are having sleep problems, completely cutting of any booze for about a week shows wonderful results, despite the initial setback.