It's important not to ruminate on bad thoughts (when your proposal is a good replacement behavior), but it's also important not to bottle up natural human emotions as if they are unjustified or unreal.
A thought exercise: if it wasn't your behavior that caused your own despair, but your spouse's behaviors that caused you irritation / grief. Do you think it's better to paint a smile on yourself and ignore the underlying problem, or spend a few minutes feeling your emotions, describe the cause to your partner, then politely suggest a substitute behavior? The former builds resentment and bottles up strong emotions for an inevitable outburst down the road. The other diffuses the emotion, potentially alleviates the offending behavior, and doesn't betray what you authentically emote.