i believe its firstly a heart issue, followed by examing the object and intensity of your anger.
For motive, i imagine its quite clear that we must have only godly anger. However, when considering the object and intensity of the matter, we must be careful not to direct it to the wrong object, hence be slow to anger. If we're slow to anger, we can better examine and direct our anger to a specific thing. For intensity, we have to be sure our level of anger is the right measure for the situation. Did the person sin without knowing? Don't explode on them. Did the person cheat on their wife, don't go in a joyful attitude but in a serious spirit with the proper level of anger. In other words, don't rebuke when an admonition is needed. Likewise, don't correct them when a rebuke is needed.