One of the best techniques for preventing yourself from becoming angry when someone insults you is to say to yourself, “Thank you, Almighty, for sending me a relatively painless way for atoning for my wrongdoings. It is a great act of kindness on Your part to atone for my mistakes in this manner.”
Keep saying similar statements during the entire time someone insults you. ~ Erech Apayim as quoted by R’ Zellig Pliskin