I feel most other answers tell you to make your story in a way where the racist character will fail or at least loose out due their racism. This might make a good story but it is unfortunately not historically accurate for large parts of human history. 

**If** you want the historical accuracy then racist characters can be very successful in life. More accurately almost all very successful people where racist old white men (or whatever other group was dominant in the historical setting you are interested in). Of course this turned out miserable for most people in these societies and you can focus on these aspects.