How do I learn not to take things so personally?

The littlest thing my boss says to me has me running in the bathroom to cry. I beat myself up constantly. How do you stop talking so mean to yourself? The boss told me I was rude and it hurt my feelings. All I could think was I deserved to be chastised because I was being flip, or rude, and I’m stupid and I need to learn to shut up.