James 1:19, 20 My dear brothers, take not of this: Everyone should be quick to listen, slow to speak and slow to become angry, for man's anger does not bring about the righteous life that God desires.
Ephesians 4:26,27 In your anger do not sin: Do not let the sun go down while you are still angry, and do not go give the devil a foothold.
Proverbs 29:11 A fool gives full vent to his anger, but a wise man keeps himself under control.
So how can we get angry and not sin:-
Get angry, but it shouldn't take you long to return to normal, apologize to whoever made you angry, be slow to speech and better burn inside than exchanging words, pray silently when you feel anger, think before you act, Imagine if it was Jesus in your place, what would He do?, Be honest don't transfer blame, forgive and forget, Do not revenge, and solve the problem by communication.