I used to have insomnia as a child and had to take a medicine specifically to help me sleep. When I eventually came off that medicine, I was fine for a while. Eventually i started waking up in the middle of the night several times though and nights felt like they lasted forever. Ever since my psych prescribed an anti anxiety pill for me to take before bed, it's been better again though.