Also, how do you stay away from thinking and fantasizing about these things?
It's the classic "Don't think of a zebra" problem. You can go months without thinking about zebras, the argument goes, but when I say "zebra" and tell you
not to think of them, you think about them all the time. Another example is a juvenile "game" some of my friends played back in college, where if you think about the game you have to announce that you lost the game. You see a member of the friend group, your brain recalls there's a rule about this friend group, what was it? Ah yes, the game. That you just lost. And then you have to announce that you lost it, which makes them lose it as well. Not thinking about porn or eroticism is like that, especially when you are habituated to using it as a go-to coping mechanism, and as you become conscious that you need to fight it. Fight what? Porn. And now you're thinking of porn.
Apologies for the long preamble, I only want you to know it;s a common problem and we've thought about it a lot.
The way to not think of a zebra is to think about elephants. Or robins, or electrical engineering. Zebras are going to occupy the empty space in your mind, so you have to fill your mind with good things, so there is no room for the things you don't want to think about. There are a lot of things to think about. There are your goals, and your plans to meet those goals. There's ideas to contend with. There's films and books. There's philosophies and scriptures. Mantras or catechisms may or may not sound hokey to you, but there's a reason repetitive affirmation of truth has persisted in so many different cultures, for so long. If you're too tired or busy to engage with ideas on a critical, analytical level, just find a phrase that is true and repeat it. It can be "Jesus loves me anyway," it can be "I am Kenough," just make sure you believe it is true and soak in it.
The other thing you can do is reduce the amount of triggers in your life. Triggers are sometimes obvious, like IG models or a provocative scene in a film or show, but often they are stressful events, or gaps of boredom. You can work on cutting those out as well. And finally, you are under less stress when you take care of your body. I don't think it's a coincidence that guys often are more successful at excising porn from their lives when it is part of a comprehensive self-improvement campaign. When you take control of your diet, cutting out empty carbs and oils and inflammatory agents, adding necessary nutrients, and when you exercise to add elevated heart rate, resistance, tension, and sweat to your life, you find your baseline stress is reduced. Cut down on screens and other blue light, and get to bed at a decent time, and you're doing that much better.