How can you tell someone is making fun of you?

They say stuff directly at you or to there friends. If they hurt you in any way for no reason. You never know. It also depends on how they say it, is they say, "Nice shirt!" they could be complimenting you or being sarcastic. It's all in the voice.