Though we may be entirely justified when harmed or offended, the Lord provides a higher preferred way if possible -
"...if men will smite you, or your families, once, and ye bear it patiently and revile not against them, neither seek revenge, ye shall be rewarded;
24 But if ye bear it not patiently, it shall be accounted unto you as being meted out as a just measure unto you.
25 And again, if your enemy shall smite you the second time, and you revile not against your enemy, and bear it patiently, your reward shall be an hundred-fold.
26 And again, if he shall smite you the third time, and ye bear it patiently, your reward shall be doubled unto you four-fold;
27 And these three testimonies shall stand against your enemy if he repent not, and shall not be blotted out.
28 And now, verily I say unto you, if that enemy shall escape my vengeance, that he be not brought into judgment before me, then ye shall see to it that ye warn him in my name, that he come no more upon you, neither upon your family, even your children’s children unto the third and fourth generation.
29 And then, if he shall come upon you or your children, or your children’s children unto the third and fourth generation, I have delivered thine enemy into thine hands..." (Doctrine and Covenants 98:23–29)