I had bad insomnia during graduate school, tried just about everything under the sun (medication, sleep studies, lifestyle changes, herbs) and eventually did CBT-I with a therapist, and that was my ultimate solution. She had me start with going to bed at 3am and waking up at 7am for a week. I was absolutely exhausted, felt like my days were dreams. Then, we pulled forward he’s time to 2am. Checked how long it took me to fall asleep, and if I reported it was quick, then pull it to 1am, etc. until I was falling asleep quickly but also felt refreshed. I kept this all down on some worksheets provided.
The key was absolutely no matter what, no matter how tired I felt, I had to wake up at 7am and get out of bed. No naps.
We found the optimal spot to be 11pm lay in bed, and wake up at 7am. I always keep that schedule, deviating only by 30min or so even on weekends. Haven’t had trouble sleeping since!
I also think going from graduate school (little solid schedule) to a corporate 9-5 job helped. Covid has mangled that a bit, but I still keep the same sleep schedule.
tl;dr- CBT-I was a life-changer for me.