I usually experience this kind of obsession after a social event. I'll drink too much beforehand, then once I show up, I'll inevitably have some sort of forced, jocular interaction with someone which leads to me saying something that I feel is inappropriate, irrelevant, or downright stupid. Then I'll agonize over it for hours afterwards as I sober up, oftentimes in the days following as well, thinking what a dickhead I must've sounded like.
The truth is that nobody really cares about what you said. It's rarely a big deal to the recipient - they mostly don't even remember the interaction at all. So I think it's important to try to separate yourself from that obsession by recognizing that it's happening and then trying to let go once you're aware that you're doing it.