Before I give what I believe to be the best way to stop racism, just want to clarify things with a few definitions:
Firstly, what is racism? A common sort of definition which I think most people would agree with is 'Discrimination against someone based on their race (i.e. certain natural characteristics such as skin colour) '
Now, I'd like to point out that the umbrella concept which racism and all other things like that e.g. sexism comes under is discrimination. Every single version of mistreatment based on some kind of superficial trait is discrimination. Therefore, rather than focusing on just racism we could focus on how to stop discrimination.
The way to find out how to stop discrimination is to look at what causes it. This is simple: all discrimination happens due to one person's belief that they are superior to another person. As this is discrimination generally, it could be any kind of discrimination e.g. racism, sexism. Note that I say 'belief' which means they have no logical proof for believing that a certain superficial thing about them makes them better than someone else.
So what makes people compare themselves to other people and sort of 'rank' themselves as either better or worse? I'd say pride, but I only use the word 'pride' for lack of a better word. What I mean is, people who have pride and then act opon it. So you could be proud of the fact you've earnt a lot of money, but as long as you're modest about it and don't start thinking and then subsequently acting as if you're better than a poor person, you're okay. The second pride becomes a problem is when people actually act upon it.
Another example for you:
Imagine two people who both have a PhD in medicine. One may say "I'm really happy with how I have such a good expertise and so much knowledge in this field - I'm really lucky." The other may say "I'm so brilliant I'm a doctor, look at all these other people who aren't as intelligent as me."
See the difference? The second person is prejudiced towards everyone who isn't a doctor, and will likely discriminate due to that prejudice. The first person however shows no prejudice with which to discriminate based on.
So thats my take on it anyway; people's pride lead to them becoming prejudiced and then discriminating against other people - totally irrationally in the case of racism.
You can't really stop it in my opinion. As long as its socially condemned, thats as good as we can get, so we're doing good at the moment.