Hey it's a good question,
The way I see it, you have to work on 2 things:
On one hand you have to build the strength and confidence to be able to stay clean and not "fall into a rabbit hole" when you are exposed against your will. Keep telling your self, "HaShem will give me the strength to get over this" and similar positive thoughts/affirmations
on the other hand you have to putmore effort into blocking out the inappropriate content that you are able to avoid. Consciously acknowledge, and hastily eliminate any gaps in your filter. Strengthen your filter, change settings, delete apps, stubbornly avoid problem areas & people. Basically reassess your physical, and digital environment and take decisive action to eliminate problematic exposure.
Make sure to celebrate any step you take in the right direction, it will give you strength to go further.
Hatzlacha