It’s easy to take it personally when someone is rude to you, or treats you badly. Try to remember that it’s not about you.
Everyone is walking around with their own baggage; their own issues; their own problems. When they treat you badly, it almost never has anything to do with you.
This doesn’t mean you should accept other people’s bad behavior, just that you should remember that they are expressing feelings about something that have nothing to do with you. You just happen to be the one in front of them at the moment.