You cannot always prevent unpleasant things from happening, but you can develop the habit of self control and what happens does not matter but your reaction to them is what counts. The same disaster that causes one man to commit suicide will cause another to redouble his efforts and succeed. Train yourself to smile in the face of seeming defeat. The misfortunes of today are things to laugh about next year.
Every destructive emotion is a wasteful emotion. They always waste your energy and make you less able to meet a situation, whatever it may be. Great anger leaves you weak and unable to put forth your best efforts for some time, while suppressed, pent-up emotions are one of the surest causes of disease, for any destructive emotion disturbs the chemistry of your body and always causes illness in some measure.
If you find it impossible to prevent such emotions from getting started - make yourself repeat an affirmation that will counteract the emotions you are trying to control. Do not try to crush all emotion from your life. Simply replace all destructive habits of thought and emotion with constructive ones. Encourage and develop your capacity to express love, happiness, contentment.
I like to say "cancel, cancel, cancel" when I start down a road in my head that is negative, self doubting, worry etc...then after the cancels, I then say something like, there's got be a way, or everything happens for a reason, or I am powerful, successful and happy or another affirmation. The cancels are a great mantra trigger to break the negative cycle. Try it next time you are hit with a negative or unpleasant situation.