When there's been an affair, the first reaction of the spouse is to be in a state of shock. And then the spouse moves over to thinking obsessively about the affair. Obsessing is a thinking process and it ends up being destructive. What's needed is an emotional process for healing. Obsessing is going around and around in your head over the same information, like a squirrel in a cage.
Healing comes at a deeper level, the emotional level.
It means, though, that you have to really let yourself feel your pain and your fear. Anger by itself won't do it. You have to share your pain with the spouse that had the affair, and it helps if your spouse can really hear your pain. Shifting from obsessing into feeling your pain takes a little while. You'll only gradually let go of the obsession.