From Sahih Muslim (Hadith 4333):
Abu Huraira reported Allah's Apostle (ﷺ) as saying:He who emancipates his portion in a slave, full emancipation may be secured for him out of his property (if he has money) if he has enough property to meet (the required expenses), but if he has not enough property, the slave should be put to extra labour (in order to earn money for buying his freedom), but he should not be overburdened
Reference: Muslim 4333