Something it took me longer than you've been alive to learn - people can't MAKE you feel a particular way unless you cooperate. I think the secret may be to jam the mechanisms in all those doors that slam down when we're hurt and think about whatever just happened.
Someone said something hurtful. Was it a criticism of something you said or did? Was it a valid criticism? Is there something you need to change to make it easier and less painful to communicate?
The way we interact with the people closest to us is like a dance and the moves are all set before the dance starts. You do or say A, i react B, and you react to my reaction, C.
The first thing to do is stop dancing. Listen to what the other said. Wait till they stop talking before you answer, and when you answer, don't answer with the same dance step. Change the pattern. With practice you can wring some valuable information out of the experience, which almost never happens when you're doing the family Highland fling. Or locked alone in a room feeling hurt.