Emotional self-mastery is not about never having certain emotions, it is about becoming very skillful with them. For example, in Buddhist psychology, there is an important difference between anger and indignation: anger arises out of powerlessness, while indignation arises out of power. Because of that difference, when you feel angry, you feel out of control, but when you feel indignant, you can retain full control of your mind and emotion.
Hence, you can be emotional and fighting for change without ever "losing your cool." Indignation is, therefore, a skillful state and a good example of self-regulation at its best. I think the person who best personified this was Gandhi. Gandhi was not an angry man, but that did not stop him from fighting injustice or leading massive marches. And all that time he was fighting, he never lost his calmness and compassion. That is how I want to be when I grow up.
Still, there are situations in life where you really need to dampen unwholesome thoughts or emotions. What do you do?
I think the first question to ask is whether it is possible to prevent an unwholesome thought or emotion from arising in the first place. In my own experience, I think it is impossible. In fact, Paul Ekman, one of the most eminent psychologists in the world, told me he discussed precisely this topic with the Dalai Lama. They both think that it is impossible to prevent any thought or emotion from arising. That must be the correct answer then, since Paul, the Dalai Lama and myself can't all be wrong at the same time, right?
However, the Dalai Lama added an important point, which is that while we cannot prevent an unwholesome thought or emotion from arising, we have the power to let it go, and the highly trained mind can let it go the moment it arises.
The Buddha has a very beautiful metaphor for this state of mind. He calls it "like writing on water." When an unwholesome thought or emotion arises in an enlightened mind, it is like writing on water; the moment it is written, it disappears.