When I went through a horribly stressful time at a previous job with bullying included, there were times I didn't sleep for four nights. My husband saw how bad it was and convinced me to see a pdoc. He gave me leave from work and put me on low dose seroquel to help me sleep. Now I read that prescribing it for sleep is a bit controversial, but at the time I was ready to try anything. I couldn't function. The first nights I slept, but strangely, like my body was asleep but not my mind. Then I started to sleep better.
These days I alternate between insomnia and sleeping okay. I was laid off from that job when I came off my leave, which was for the best.
We are in winter in the Southern Hemisphere and I sleep better. Lots of blankets and a mattress topper create a cozier environment. The summer heat here makes it all worse, for sure.