Do you leave yourself enough breadcrumbs that you can pick things back up in the morning? What's causing you sleepless nights? I find it helps me sleep better as I know I've dumped the context out of my brain and don't need to put effort into retaining it until I can get back to the task at hand.
Not who you replied to but I'm in the same boat re: sleepless nights.
It's not quite literally that bad but it's distracting for sure.
I just can't seem to leave enough breadcrumbs to stop ruminating about the problem after work.
Of course working from home doesn't help the situation. But sometimes it feels like I have to leave so many breadcrumbs and capture so much context that I might as well just do the work...
If I do have a problem then I write down every thought so it's out of my head for sleep. Nothing worse for me than trying to solve the problem mentally when trying to sleep.