I have racist thoughts but I don't want to
How bad are these racist thoughts that you want to cut them out?
They are pretty bad. On the internet I am a nice person, but in the real world, I am a racist and a bad person.
I'm glad that you acknowledge that these thoughts are wrong, so you need to do your best to open your mind and be more welcoming. If you let these thoughts spill out into the real world, you really need to go to therapy and help yourself to make others feel comfortable because such discrimination is ugly.
I don't want to take your advice but you are right that I need to change.
Good. Admission that you act like a racist is the first step because being prejudiced against others is not correct. Speak with a counselor so that you can get the help that you need to change.