Every time I've ever had a big test, a presentation, a job interview, the first day on a job, a meeting, a doctors appointment, a big trip the next day, and literally everything else you can think of, I have stayed up all night. At first it's an issue of anxiety, but by 3 AM it turns into "well if I fall asleep now I can't trust myself to get up in the morning so I might as well stay up all night."
That part about being afraid youll oversleep is also anxiety.
Anxiety prevents sleep, general advice is to have a routine that calms you down.
My thing is just somehow convincing myself theres nothing to be anxious about. It really helps though if you can handle whatever might happen as a result.
Last time I couldn't sleep like that it was because I had sentencing in the morning and I didnt think I could handle prison. Luckily I didnt have to go.
My problem is that when I don't get enough sleep I just sleep through my alarm. It's definitely anxiety but this one is based in reality, unfortunately. I've made that mistake a few times...
Here's a pro tip: sleep a lot the day before, and ideally the day before that too. On the important night don't exhaust yourself with gaming or whatever, but don't force it. You'll end up sleeping maybe 4h, but if you slept well the previous two days, you'll be fine.
Sleep deprivation only really shows over prolonged periods of time. You can ace a lot of tests with the above method.
My problem is that if I don't get enough sleep I will sleep through my alarm. It's definitely anxiety but this one is based in reality. I've definitely made that mistake a few times...
Can attest that it works great, except for the dogshit sleep quality, like with almost every sleep aid known to man. (except for GHB and Pregabalin, but these have their own issues)