Big disclaimer, in general I do not personally care about people race, sex and age.
I try to treat every person fairly.
I keep on earing that racism is bad.
If so many people are racist there should be a good evolutionary explanation why it is so.
People coming from different places (villages, tribes etc…), could potentially bring diseases or destruction.
Therefore, it was in the common interest of the tribe, to have some skeptical individuals, which want to keep similar people around. By similar I do not mean only racially similar, but culturally similar, same language, religion, tradition etc…
It was not unusual in the past to get diseases from outsiders or to be conquered and than enslaved. What often starts with innocent trade generally ended with death and subjugation. Therefore, people where selected to be suspicious of outsider and therefore racists.
Plus most of people tends to favorite people that are close to them.
Given the same skill level, you are most likely would hire your cousin over a total stranger.
Now my interpretation of history:
Slaves where generally taken with conquest. If you can get power militarily or economically, then you have access to slaves.
The majority of people did not consider humans of different races as inferior, but slaves as inferior.
Now if the sun is intense, then people with a dark skin tone are more fit to work in fields.
The Trans-Atlantic slave trade involved mostly black people. That was not a racial problem but an economical one. Economic and not racism is generally the reason for slavery. Slaves were resources, civilizations needed slaves to run the economy, and therefore, people organized military campaigns to get human labor elsewhere.
Hitler and Jews. I personally do not think that the problem there was racial but economical.
Jews are different from Arians but not that different. Black people or eastern (Chinese, Japanese etc..) races look more different than Arians.
Jews were persecuted first because they were richer in average. Racism was the official reason they where persecuted but not the practical reason.
Racism is almost always the outcome, and almost never the cause.
Instead of fighting racism, which is embedded in human nature after millions of years of evolution, we should understand what are the underlying economical problems in our society.