There is a picture going around that says that God is good with slavery, and even quotes
Ephesians 6:5 Slaves, obey your earthly masters with respect and fear, and with sincerity of heart, just as you would obey Christ.
Reading a single Bible verse can be very misleading, you must read more to get the full picture of what the Bible is saying.
6 not by the way of eye-service, as people-pleasers, but as bondservants of Christ, doing the will of God from the heart, 7 rendering service with a good will as to the Lord and not to man, 8 knowing that whatever good anyone does, this he will receive back from the Lord, whether he is a bondservant or is free. 9 Masters, do the same to them, and stop your threatening, knowing that he who is both their Master and yours is in heaven, and that there is no partiality with him.
God was not endorsing slavery here, he is acknowledging that slavery exist, and warning the people that he does not divide slaves and freemen, he thinks of them exactly the same way. If you mistreat a slave it is just as wrong as mistreating a free person.
Suggestion for further reading
Is God a Moral Monster?: Making Sense of the Old Testament God