If you are willing to look at another person’s behavior toward you as a reflection of the state of their relationship with themselves rather than a statement about your value as a person, then you will, over a period of time cease to react at all.
Where do we enroll in Life 101? Where are the classes dealing with the loss of a job, the death of a loved one, the failure of a relationship? Unfortunately, those lessons are mostly learned through trial by fire and the school of hard knocks.