Criticism hurts, even when it's justified. Experts say the first thing to do when you feel you've been criticized is to think carefully about whether the criticism is justified or just a gratuitous insult. After all, a lot of criticism is motivated by jealousy. Also consider whether the person criticizing you is uninformed — or just plain ignorant. It's easier to deal with criticism when you know what's motivating it.
If you feel the criticism is unjustified, the most important thing to remember is to stay cool. Getting angry does not help; it just lets the other person know they've scored a point.
On the other hand, if the criticism is merited, and is meant to be constructive (even if it doesn't sound that way), then try to put it in perspective. After all, it's something you can learn from. Listen to the criticism and take responsibility for your actions. If you need to, ask for specifics and show you are taking the criticism into consideration.
Importantly, after you have dealt with the criticism, move on. Don't brood on it.