Cat's recommendation (writing down the intrusive thoughts) has worked very well for me. The only problem is, if you're at work or school you might be nervous about people finding/reading them.
I started writing them in Leet (1337) and that works pretty well! All most people see is a page filled with numbers and symbols and they don't attempt to translate it. You can learn Leet easily by doing a Google search for it. It's really fun to do in handwriting.
Example: 1 \ / \ / 4 / \ / 7 70 | ) ! 3 (I want to die)
If you know an ancient or foreign language, that works too. Not only will you be addressing the intrusive thoughts, but you will be exercising your mind as well!