They didn’t enslave people because they were racist, they enslaved people because it was effectively free labor. Sure, they chose Africans because they were racist and thought them savages, but that isn’t why the institution of slavery existed.
Slavery was introduced in the New World and not in Europe, because that's where the non-Europeans were. When the native Americans proved poor slaves (among other things, dying in droves from disease and being better able to escape due to knowing the area), they imported slaves from Africa.
The Africans had been practicing slavery all along, but the Europeans had considered it barbaric until then. They still didn't tolerate it within Europe, but only safely out of sight in the New World. The institution of slavery only came into existence after colonizing places inhabited by people of other races.