While the human mind is described as being a stream of consciousness, that does not mean you can’t decide where your stream flows. Techniques like meditation can flush out negative thoughts which will aid you immensely in learning to control your mind.
Learn to control your emotions. The only person that can make you unhappy is you! You’re the one that decides to be affected by the words and actions of others. Realise this so that the next time you experience a negative emotion, you can find the strength within yourself to overcome it.