Although its almost a cliche at this point, stopping and counting to ten is always helpfull when trying to remain calm. You could also visualize something calming or breath slowly through your nose. If you are trying to avoid getting angry at someone then the best solution may be to excuse yourself and get away from the person for a while, perhaps take a long walk. The old phrase "live and learn" comes in to play also, if you do get angry at someone you will almost always regret it later.