The Bible doesn’t just outright command anyone to remove the practice of slavery in all forms, just as it doesn’t speak directly against certain other practices that develop in some cultures and not others. Instead, it spends it’s time mostly on revelation of God’s nature and of general truth principles that can guide people at any time in any culture. For example, Jesus teaches people that the whole law is essentially expressed by loving God and loving your neighbor the way you love yourself (Matthew 22:36-40). If you have that guiding principle, you’ll move towards loving people well in the more specific ways that the law helped Old Testament believers to do, such as not stealing from them or killing them. And no one wants to be enslaved, so people transformed by the truth of the “golden rule” would choose to get rid of slavery as they grow in Christ if slavery was part of their culture to begin with. And that’s what happened in history when nations like the United States and Britain conformed to Christian truth; slavery was abolished nationally, largely due to Christian influence.
The Bible does, however, speak on slavery since it was part of the lives of the people at the times in which various books were written. In the New Testament, Paul speaks in the letter to Philemon about Onesimus, a “slave” who was parted from Philemon his master, and Paul asks Philemon to receive Onesimus back as a brother and not as a slave (Philemon v.15-18). The actual word Paul uses is bondservant, not slave, which refers to someone who submitted to servanthood to repay debt, though he may not have wanted to continue to serve willingly later, but he would yet have been bound to do so legally. But Paul elevates these believers’ relationship to being brothers in Christ. As he says in Galatians 3:28, all that matters now is oneness in Christ, not whether someone is free or enslaved. Paul abolished all worldly divisions in light of the Gospel.
Paul also gives guidance on proper treatment of slaves by masters and conduct for slaves towards masters (e.g. Col. 4:1, 1 Tim. 6:1). Those slaves would also likely have been the voluntary sort in the sense that they chose to go into a slave-like, indentured servant relationship with an “owner/master” in order to pay a debt. The same was true of ancient Israel when Israelites were slaves to each other, and the law laid out rules of conduct offering slaves certain protections. Also, every seven years, debts were forgiven, and slaves were set free.