“It’s not what someone said, it’s what you’ve heard.” You have the power to interpret someone’s words.
The other person said some words. It’s you who gives meaning to those words. You can take those words to heart, disregard them, laugh at them, learn from them, get outraged or provoked… It’s really up to you.
While we cannot change the words that come out of other people’s mouths, we can control how we choose to hear (and remember) them.
It’s not always easy, but it is always up to you. You can think of their words as being in bad taste or coming from a hurt or stressful place within them.