When we interact with others, we have the choice to listen and interact but keep in mind their words express their character and the state they are in. You don’t need to take it personally.
Their words are only based on their own experiences and emotions. If you take them personally, you will get hurt for no reason. Always try to acknowledge the root of your feelings. What’s the cause of you feeling this way? Sometimes it is a little insecurity. Acknowledge it and let it go. Sometimes, it will help to create a distance between you and that person so you can think about it. At the same time, try to put yourself in that person’s shoe. A person may be having a bad day and say something with no intention but it reflect on what’s going on with them.The way you take it reflect only on your own issues.
At the end, don’t let no one perception and actions effect your self-worth. Your life is yours and it’s up to you to influence your own value and the sense of a healthy human being.