Realize that even the greatest people make errors of judgment when they are angry. Moshe was on an extremely high spiritual level and had profound insights. Nevertheless, when he became angry he erred in understanding the Almighty’s will.
Think of three incidents when you made mistakes because you became angry. Right now, mentally “relive” those situations and imagine yourself handling them instead in the best possible way. Let this serve as a resource for the future.
Sources: see Ralbag – Shaar hasavslanus, no.10