I’m going to piggy back on this, because sleep is incredibly important for me.
But more than that — routine is more important, and you mentioning habits is the way to get there. Want to help yourself sleep better before bed? Maybe walking every day between dinner and rest is what’ll help. I can’t say what works for others, but that’s what works for me, with anxiety/depression. The consistency is key.
Another option for OP is to set goals. They don’t have to be major; maybe it’s signing up for an event (I’ll use a 5k as an example) that’s months away and then training for it. Have reasons to look forward, and not dwell on the present/past.