I will close my eyes and refuse to sleep if my brain is thinking about something. If I have thoughts actively in my head, ie. tomorrow, today, anything, I will not go to sleep, because I know I will dream.
Without regurgitating what is already around, about.com has a good piece about four immediate things that come to mind:
http://stress.about.com/od/generaltechniques/f/clear_mind.htm
- Meditation
- Cultivate Mindfulness
- Expressive Writing
- Distraction
Meditation never really did it for me. 2,3 & 4 work well for me. Two... something like watching a TV show and becoming fully engrossed in the comedy of it, then literally turning it off and falling asleep.
Writing... I have done a lot of that and used it in the past to get all my thoughts out, so I don't go to bed thinking.
Distraction... even sex is a good distraction to engross yourself in it before sleep, as well as the chemicals created after an orgasm that create sleep, for both sexes.
I ensure I set my mind so that when I stop doing things in the day, I don't have something pressing to do, because if I do then I will dream about it / dream or have a nightmare. Even updating the forum... if I feel like something is not completed when I go to bed, then I could have a nightmare as I would have a hard time getting it out of my mind, or if I went to bed thinking about coding or some other aspect in web design, etc... then I would dream / nightmare.
So preparation of my own mind is also key when I finish things, being I pick a point and finish, accepting in my mind that I am finished with it for the day and don't have to carry any urgency or such to bed with me. If you carry those thoughts you will dream about it or have nightmares about something else, because you bring negative emotion to bed.
Its like having a fight before going to bed... nightmares often pursue. The old saying of "don't go to bed angry" is very true.
You have to think about anxiety in general... any negative emotion you carry into bed will enhance anxiety. If you are anxious about the house being locked, you will have nightmares, so you're better to literally go around the house and check every lock, window, etc... if it relates to you. I do... it is the last thing I do each night, being to check every door is locked and know if any windows where opened during the day, ensure they are locked... then I don't carry any negative emotion about that to bed with me, ie. is it easy for someone to get into the house at night?
Remove harbouring and carrying negative emotion to bed... thus your mind is clear of negatives. I also clear positives myself... through simply having trained myself that I don't look forward to things. I do... but I don't get all excited about it until the event itself, that way I don't endup having a nightmare because I can't clear my mind of something good. It works for me... but its always individual.