What came first slavery or racism?

Of course, there was slavery in some parts of the world before there was racism. The Romans took slaves who were not distinguishable by their race. They were not seen as racial inferiors, they were just people who had been defeated in battle.

Assuming that you are asking about race-based slavery, there is no definitive way to say. Scholars often argue that the two grew together and reinforced one another. When Europeans first came into contact with black Africans, they would have seen them as inferior even without them being enslaved. They would have seen the Africans' lack of technology and believed them to be inferior. If this is racism, it probably came first.

However, really systematized racism's existence was encouraged by slavery. There was a need to justify the enslavement of a whole race. This would have made it important to create an ideology of race that held that blacks were naturally inferior.

So, slavery in some forms has existed since before racism did. Racial slavery, though, developed along with racism.