Cutting coffee to just the morning definitely helped me.
My problem now is that if I think of anything vaguely interesting in the evening then my brain refuses to stop thinking about it. That and restless legs.
Evening if my main time for hobby projects so having them lead to disrupted sleep is really annoying. Any tips?
Magnesium, L-Theanine, and vitamin d. Make a regular bed time for yourself, and stop looking at screens 30 minutes before that time. Regular is more importantly than early, I.e. 11:30 is passable but only if it's always 11:30.
I always aim to stop doing anything with high cognitive load at least half an hour before getting ready for bed.
Not necessarily no screen time, but coding stops, and the remaining time is spent gaming or watching TV, or I go to bed early and read.
Wake up early and work on hobby projects in the morning. That's what I personally do sometimes.
Meditate
magnesium glycinate (and/or a liquid IV or equivalent before bed) helped my restless legs
I don't have any severe sleep problems, but I can relate to this issue. I find reading fiction helps. It's kind of difficult to dream about an interesting problem or a project, so the way I perceive the problem is that my brain doesn't slip into a narrative free-associative state. But if I can get myself to think about something "dreamable" then it's a different story. A book works b/c you already need to engage your imagination quite a bit as you read anyway