Insomnia: Falling asleep at midnight, waking up at 5 pm

Kat

So a couple days ago I woke up at 5 pm after not being able to sleep. Now I cant fall asleep or wake up. I've tried medications and meditation a lot and I've been having nightmares so it might be in part to traumatic experiences. Any help?