Inability to sleep is always stress based. It isn't necessarily a bad kind of stress; for me it is often the result of being all riled up thinking about things that are interesting to me or something like that. I am so stuck thinking about what I am going to do tomorrow that, if I can get away with it, I'm likely to stay up all night and realize that "tomorrow" started being "today" a long time ago.
At this present moment, I'm not employed at a job that requires me to be anywhere at any particular time, so my schedule is even more messed up as a result. I have gotten out of the habit of forcing myself to go to bed at a certain time. As a matter of fact, I didn't go to bed at all last night. I tried to go to sleep around 3 AM, but just layed there with my heart beating like a terrified rabbit, until I got up again. Now it is 9 AM and, to be honest, I still don't feel properly tired.
...Overall, the key is to eliminate whatever is stimulating your brain and replace it with something relaxing, and if possible, boring as well. I keep a big notebook full of ruled paper by my bed, and a small pile of books. After 30 minutes or less of writing and reading, I usually drift off without a problem. Sometimes nothing seems to work though, and that can be a pain.
#1 pointer for right now, however; if you really have to get the rest, shut down the computer, close the blinds, and lay there in bed for as long as it takes. If you force yourself to breathe slowly, that will slow your heartbeat; counting also helps clear your mind. (I find that a sequence counting up with only single digits works best - i.e. eight nine ten one... eight nine twenty one... ninety one... eight nine one-hundred one... etc. works better than the ten, eleven, twelve... twenty one, twenty two... one-hundred-one, one-hundred-two style for trying to go to sleep.)