How do I stop thinking about my boyfriend sexually?

We used to sext and such and just have a sexual relationship in general, but we decided to put it on hold for the sake of our relationship. But that's not what I'm here to talk about.

How can I stop thinking about my boyfriend sexually? It's obviously not 24/7 or anything. But every once in a while a thought would come to my head and I would have to think of something else.

I don't like thinking of people sexually if I'm not sexually involved with them. It makes me feel gross and guilty. I just can't bring myself to do it.

I tried masturbating, but I immediatley start thinking about him, and I have to stop.

I'm not sure what to do. I guess I should just stop masturbating, which I'm fine with I guess. I just needed it for a stress reliever.

Anyway, yeah. Any ideas would be great.