I don't believe this is true at all. I'd argue the best way to stop thinking about something, is to divert your mental focus to other thing/s intentionally. Best way to stop thinking about your ex? Find a new boyfriend, dive deep into a work problem, find a new hobby to occupy your brain power, and so on.
Want to insure you aren't thinking about something? Don't attempt to insure you're not thinking about it by thinking about it (a blatantly self-sabotaging concept).
There's absolutely no need to constantly do mental reference checks to make sure you aren't thinking about the white bear in a red ferrari. In fact, that's the worst thing you can do. You can only focus on one thing at a time, and your brain is finite, as such it's not that difficult to saturate it and drown out competing thoughts. Given enough effort and time, the bear is banished from your short term memory and its emotional hold on you is dramatically lessened. After a while you then realize that it has in fact been a long time since you've thought about the bear, and you realize said bear's hold over you is no more. All accomplished without constantly thinking about whether you're thinking about the bear.