Although I haven't had an unfaithful partner, I have had at times thoughts that I just can't get out of my head. I am bit of a self development junkie and have researched lots of different ways to overcome limiting thoughts. The best way I have found at this time is a 2 step process 1. to do EFT - Emotional Freedom Technique. Basically it works to calm down the nervous system. And 2. accept the thoughts and all the emotions attached to it. The more you try to suppress it the more it will come up and demand attention. I literally treat the thought as a young child needing attention, let it be heard, throw the tantrum if need be and once the child has been validated and heard start to re program by thinking of how you want the situation to be like (e.g. I am trusting, it is safe for me to trust again etc). I either put myself in a mindfulness state or do tapping (EFT) while I am fully expressing my feelings.
For me my feelings are my guidance system - if I feel any discomfort it means I have more work to do to release the issue. Often the issue comes back to a time in our childhood when we felt wounded for any reason. Just remember as children we do the best we can but have a very limited view of the world and how to deal with issues that come up. So the issue might seem trivial to us as adults but to a child it could be very distressing. Until we deal with the issue and release the pain, fear or what ever the negative emotion is it will keep coming up to haunt us.
Hope this helps