Do you ever find that the anxiety or panic you feel when you wake up in the middle of the night is worse or harder to bear than any that you feel in the daylight hours?
I'm sure that's very common. My sleep is so deeply affected by my racing thoughts that I often find myself in pure panic-mode around 2 a.m. The first thing I do is not panic about the panic. I realize that my thoughts have been running reckless for a time and that they are manageable.
Second, I do turn on the light and prop up a bit if I have to. Lying there in the dark sometimes keeps me sunk into that same cycle of "oh my gods" and "what ifs" and "I haven'ts". A change in position, a redirection of focus is what is needed then.
Then I turn on my meditation guide (either through Alexa or an app) and allow my thoughts to center around the words from the calm voice guide. If I'm too lazy to do all of that, I can sometimes guide it myself. I have recited poems, or played out a movie in my mind, or even went back to a fond memory and relived it in my head.
Worst-case scenario, I use a compress and count out loud. Even if it takes me to 1,000 (which it never does), I keep counting.
Having these tricks in my back pocket make the first waking moments at 2:00 a.m. much less terrifying.