I've had trouble sleeping since I was little. Usually when I especially needed to get to sleep because it was an important day the next day. And the more I worried about it, the more panicked I got and then there was no way I could get to sleep. Sometimes I wouldn't get to sleep until an hour before I had to get up! Even on days when sleeping wasn't that important, if I looked at the clock when I'd been lying in bed for a while I'd start thinking, "why aren't I asleep yet?" which would immediately mean I couldn't.
If you are having trouble sleeping, but don't have the kind of insomnia where you just don't need much sleep, here's what has worked for me:
A lot of the time the main part of the problem is mental, like stress, worry or not being able to shut your brain off and just relax. So tell yourself that it doesn't actually matter if you get to sleep, because when you are tired enough to need to eventually you will. Write down any worries or thoughts that keep going round in your head. Once they are on paper you will feel like you can forget about them for the moment. Have a bedtime routine, like a few things you always do before you go to bed which trains your brain to start getting ready to sleep. Have a drink, brush your teeth, put your pj's on, etc, then get into bed. Instead of thinking about getting to sleep just concentrate on how comfy your bed is and how warm and cosy you are, so you don't care how much you actually sleep because you're so comfortable. Concentrate on that and just let yourself relax and drift off...
The problem with sleeping pills is that they don't actually make you feel like you've had a proper night's sleep, and they're not good for you and not good to get dependant on. An alternative that does work is hops and valerian, which you can buy in liquid form to add a few drops to water, or in tablets. A few drops of lavender on your pillow will help relax you, as will a hot bath and a warm milky drink before bed. Boots has a pillow mist that smells like peppermint and nutmeg that's quite nice as well. And finally, read a book for at least twenty minutes before you turn the light off, and if you find you can't get to sleep still, after an hour, say, just read something (boring would help) until you feel so tired that your eyes are drooping and you either decide to try and sleep again or fall asleep still holding the book with the light on.
I'd say only go to the doctor as a last resort. I hope this helps. Good luck!
