There Is A Purpose
It is important to know that there is a purpose for everyone you meet and everything you experience in your life.
Some people will help you and others may test you. Sometimes those are the people who are not so nice. Still, we learn from negative experiences with others as well as the positive experiences.
If you happen to have a negative experience with someone, just remember that this negative person is struggling to become a quality person. They probably are having a hard time learning to interact in a healthy, positive way with others. Many people struggle with this for a long time before learning how to be positive.
All interactions with people will teach you something new. The most important people that you encounter are the ones who bring out the best in you, respect you and accept you for who you are. Those are the ones worth keeping around.