Good on you for recognizing that these thoughts are wrong! Now, we can't always prevent thoughts (they tend to just happen), so what you do is basically... Internally call yourself out for them? Self-correct. If you start thinking "Oh, I bet that guy is this position in bed", cut yourself off and go "No, that's fetishizing people, and I need to not......
reply