The strategies that I used to stop thinking about porn are really simple. You need something that is harmless and is able to focus your attention.
If you're at home, doing a jigsaw puzzle is great. It really can absorb your attention, and it can't be completed in a day, so you'll train yourself to delay rewards.
If you're not, counting backwards is great. Start at 1000 and go for as long as needed. If that becomes easy, try counting backwards each 3 (1000, 997, 994, ...) or 7 or whatever.
Above all, the best tool to stop thinking about porn is calling someone and talking about it. But you need someone you can trust to talk about this.
In any case, never, and I strongly mean NEVER, try to fight the thoughts directly. I mean never start thinking "I don't want to watch porn" or "I'm not thinking about porn anymore!! stop, you brain!!" That's the pink elephant scenario.