You must accomplish this through patience and persistence, as well as through determined effort.
You start off by listening to your inner voice, and if it prefers to lash out, be gentle with it. Remember: you have taught it to be that way. And just as it took time to do so, so it will take time to retrain it to become otherwise.
Think before you react.
Think before you speak, think before you act, and make it a habit that anger and hatred are the last emotions that you feel. It may take time, just as it took time to become a negative person. But what efforts you put into training yourself to become positive and optimistic will be worth it.