A method that I find really effective, which is also something which appears to be a common trend from what has been suggested above, is to occupy your mind with something completely banal, just about enough to inhibit any active and stimulating thought.
A technique I read about and always works for me is to firstly get into a reasonably comfortable position in bed, and then to slowly count down from 100 to 0. I find trying to breath slowly, and pretty much match my counting pace with my breathing.
If you find yourself switching to a new thought go back to the counting and to be quite disciplined in your concentration. I have never had this technique fail me. Though, if I get to about 40 and feel like I’m not about to drop off I go back to 99.