No More Desire

I have applied the concepts and tools in the overeating course and no longer desire food or use it for entertainment or buffering- which I have never been successful at with over 30 years of an eating disorder so thank you so much! How can I apply these same tools to stop desiring an old ex that I have had a long-distance emotional affair with over the past 3 years? I want to stop desiring him and using him as a buffer just like I’ve done with the food and honor my commitments to myself and to my marriage. I have stopped the desiring thoughts many times before by not indulging in them over a period of months but then I succumb to them again and go back into the vicious cycle.. ending it and then reengaging over and over. Any insight into ending this cycle once and for all? I’ve decided to end it time and time again and have not been successful in permanent change. I just want to not want him anymore just like with the food. Thank you.