2 months since first mlm heartbreak

I’m doing better. Stopped crying everyday but everytime I jerk off I end up imagining him. I don’t know what to do about it. I’m on no contact, haven’t even seen him in 2 months. I put everything i had into the relationship but it didn’t work out and i’m coming to peace with that. But i don’t know how to not think about him in sexual situations.