I said to Ka'b bin Murrah, tell us a Hadith from the Messenger of Allah (ﷺ), but be careful. He said: I heard the Messenger of Allah (ﷺ) say: “Whoever frees a Muslim man, he will be his ransom from the Fire; each of his bones will suffice (as a ransom) for each of his bones. Whoever frees two Muslim women, they will be his ransom from the Fire; each of their two bones will suffice (as a ransom) for each of his bones.”
“Whoever frees his share of a slave or part of his share, must pay from his wealth if he has any wealth if he has any wealth (in order to buy the rest of the slave's freedom). If he does not have wealth, then the slave should be asked to work for the price (of his freedom), without that causing him too much hardship.”
“Whoever frees his share of a slave, the price of the slave should be fairly evaluated, and he (the partner who initiated this process) should free him (in full, by giving the rest of his price to the other co-owners), if he has enough wealth to do so. Otherwise, he will have freed whatever he freed.”
“O Umair, I have set you free in a good way. I heard the Messenger of Allah (ﷺ) say: 'Any man who frees a slave and does not say anything about his (the slave's) wealth, it belongs to him (the slave).' So tell me, how much wealth do you have?” Another chain reports a similar hadith.
the Messenger of Allah (ﷺ) was asked about illegitimate children. He said: “Two sandals in which I wage Jihad are better than freeing an illegitimate child.”