Your mind, like your muscles, can be trained. The human mind is often a mess of thoughts and emotions, which seem to randomly happen at once. Emotions are the product of our thoughts, and pass quickly IF we allow them to flow on by, instead of letting them build and overwhelm. The best way to do this? Use your breath. Redirect your attention from your thoughts and emotions to the physical process of breathing (in through your nose, out through your nose, filling your lungs, expanding your belly. This might be all it takes to snap you out of a negative mindset.