I would generally agree with looking at your emotional and physical surrounding and seeing what you can do
I also will add that long bouts of lack of sleep can certainly be an issue, it raises stress hormones in the system and reduces frontal lobe functioning so it is not something to pass off as just an annoying symptom. There has been many studies done about reduced reasoning skills connected to lack of sleep.
I suffer from bouts that last 4 days or so and here is what I find works for me
Eyemask and earplugs, I have a nice eyepatches that does not hit my lashes and super soft earplugs I got at a safety store, they are low blocking but way softer, I can still hear just more peaceful.
No bright lights right near bedtime, that means no last minute computer or smartphone checking, that light shining in my face gives me crossed signals.
When push totally comes to shove I take a antihistamine. I happen to have a very light rx one that works wonders, but even benidryl works to take the end off. Not sure how I feel about that while preggo I have not looked into it yet.
The cooling off of the body helps to trigger sleep, that's is why a hot bath works because you cool off afterward. Something I found helped me was lowering the temp in our house a hour before bedtime rather than at bedtime. This seems even more important in the summer time.
Good luck I really know what a drag this is.