I find that if I am burning myself out and not resting well, it actually helps to shut off artificial lights as much as possible. -especially- tv's and computer monitors. Not only does the activity of watching them keep you awake, but the light wavelength they emit actally play havoc with your body's natural rhythms. What you are watching or doing can also stir up the mind and if if you are doing something that gets the nrain moving it is harder to get it to quiet down when you want it to.
Work on being consciously aware of the time, and disciplining yourself to shut down at least 20 minutes before you head for bed. Have some time in stillness and let your system power down with a mundane task. Something simple like a spot of meditation, or personal grooming, or a short journal entry to put your thoughts on paper(and thusly out of your head).
If this has been an ongoing problem it might be a good idea to examine what exactly is keeping you awake. IE: are you failing to go to bed on time? Is your mind running rampant and not shutting down? Do your thoughts get engaged with different emotions or cycles of thinking? Is your body being physically restless? Do you share the bed with someone and do they keep you awake? In the quiet of where you live do you get knocked from slumber by sounds, appliances, light, outside noises like cars, ringing in the ears, etc?
Each of these sources of the problem have their own solutions. Understanding the puzzle usually reveals the answer.
I want to add avoiding caffeine before bed. I never used to react to caffeine and slept like a baby no matter what I drank, but the older I get, the more caffeine affects me. They say to avoid drinking it around 5 pm.
I also want to second not having artificial lights on at night in the room. Screws with our circadian rhythm (what keeps us awake during the day and makes us sleep at night).
I use to listen to Binaural Beats on YouTube, you can find certain ones for deep sleep, etc. I use s to take Melatonin, but it only works for so long. If you live in a Medical Marijuana state and are able to get a card, that helps me sleep. I have started exercising every day in the morning so i have energy to do stuff all day. Then, by the end of the night I am tired and fall asleep easily.