You must practice Thought Control or Cognitive Behavioral Therapy.
It is like building a muscle..practice makes perfect.
Turn your thought completely to something else.
It takes awhile to learn you have immense power in this ability.
Your ego will not want you to change a thought...so what...
do it anyway.
You'll get the hang of it.