Well, the easiest one is just to think of something else. Sometimes, if you are thinking about a certain song for instance, and it is playing over and over in your head, thinking about the lyrics to a different song will help get the other one out of your head.
However, if you are talking about obsessive thinking, that isn't always easy.
Another thing to try (we'll continue with the song example) is to play some different music. Immerse yourself in something that makes you think of something new. Listening to another song, getting involved in a movie... going out somewhere with friends.
Sometimes a certain thought will be inspired by your surroundings or the things that you are doing, so sometimes just getting up and going to a different room will help. Talking to someone else often helps. Changing your physical actions or environment sometimes helps. ... if you can't stop thinking about an ex-girlfriend or boyfriend for example, stop hanging out where the two of you used to hang out. Give yourself time to make new associations with places and things. Throw away whatever it is that is reminding you.
If you are religious, you could tr