Why

I think people that really have no idea who you are don't really care what they say.   I came across someone I don't know well say some very nasty and cruel things to me today and for some reason it really got to me.  I can't believe I let someone get to me like this. I know I shouldn't let people get to me but it really frazzled me.   Any tips on clearing my mind? I need to get past this,  this person means nothing to me but even someone I didn't know doesn't deserve to be spoken to like that