What do you do when you can't sleep?
I grab some porn and masturb...umm...I mean I curl up with some classic English literature and read. :Q
Seriously, if you try many common and sensible things to sleep better but you don't find that any of it is really helping, you may have a sleep disorder of some type. You can see that the first, second, and third recommendation by most people is to advise or recommend behavioral changes, so its very easy to get the erroneous impression that sleep problems must always be behavioral or life-style related. Nothing could be further from the truth.
There are MEDICAL causes for difficulty in sleeping, too, that can NOT be remedied by a life-style or behavioral change, so attempting to 'cure' yourself is an exercise in futility. Here is an article about getting enough sleep:
Tips for a Better Night?s Sleep
Don't make the mistake that I did, which was to completely dismiss the possibility that I might have a medical condition causing my sleep problems. So, I suffered from severe sleep related problems most of my adult life, including losing two good jobs and crashing two cars from falling asleep at the wheel, all the while I blamed myself, believing that I was simply too undisciplined to get myself on a regular sleep schedule.
I finally went to see a physician, who referred me to a sleep specialist. I have borderline sleep apnea and, more importantly, a neurological disorder called narcolepsy. The sleep apnea in and of itself is probably not significant enough to cause any adverse symptoms, but since I also have narcolepsy, one exacerbates the other. These are serious conditions that can be dangerous.
Neither of these conditions are remediable by any amount of life-style of behavioral change, no matter how determined or disciplined you may be. I'm not saying that you have a bona fide sleep disorder, and its entirely reasonable that you would try many common sense things to remedy your problem at first, but if nothing seems to work, don't dismiss the possibility.