It is, of course, wrong to judge by category rather than character, and this is what gives prejudice a bad name. Prejudice by itself is not racism. Recognizing the feelings to be wrong, he may treat people of group identities other than his own quite appropriately. Or he may believe his feelings are right, but he nonetheless treats peoples of other identities well out of respect for the law. Racism is something very different.
Racists believe that certain groups are inherently inferior to other groups.
Usually, they believe the group to which they belong is superior. Racism is a serious evil of the intellectual rather than emotional realm, and is therefore entirely distinguishable from prejudice. Just as a prejudiced person might not be racist, a racist might not be prejudiced. For example, many of the slaveholders of the American South, though racists, were good slaveholders who treated their slaves well. Unfortunately, in most cases prejudice and racism go hand in hand, and this is what makes them so hard to tell from one another.