Praying, as others said, is obviously the first and best thing to do.
Being a person disposed to emotional whims, I have some rules for myself that I have set in place and try to stick to, though I oftentimes forget.
If at all possible, try not to make any decisions if you've been overcome by emotion. This of course means that you'll need to distinguish between emotion and reality,, and in the moment sometimes the two are hard to tell apart. If consciously looking for it, it becomes easier in time.
For the love of all things good and sensible, don't argue or blubber on when you know you're being emotional. It's not becoming, and 90% of the time the only thing it accomplishes is making you look like a fool. If you wish to address someone who has wronged you, to express an opinion on something that really pushes your buttons, etc, think or write it out and keep it in your back pocket for a few days. In a few days, after your thoughts are no longer clouded by emotions, and you reconsider what you wished to say, you may or may not want to proceed. In my case, I generally forget about it, or feel embarrassed by even the thought of someone being on the receiving end of that emotional tirade.
Those things aren't really helpful for keeping emotions away, but rather preventing them from doing damage.
When something tips my emotions in a big way I try to stop and consider the source. When I am angry because I feel offended or slighted, I generally come to the conclusion that to react would be giving into pride. I cross myself, say a Hail Mary and keep my mouth shut, ideally.
When I am so overcome by grief that I cannot focus on anything else, the question must be asked if grief in that instance merits my full attention. Sometimes it does, and to accept the grief and offer it up can be a pious act of charity. Other times grief can be a good in for the devil to make us focus completely on ourselves and our circuмstances, leading to isolation and despair. It's when we're in that spot the Devil can have his way with us.
I would hate to sound too harsh on emotions, though. Emotions are beautiful because God intended them. I could go on and on about ways in which emotions are good and useful, but since that is not the topic of this thread I will refrain from doing so.Just as anything else that God created, we must humbly pray to understand them and use them correctly, lest they be used to accomplish evil.