How did a prisoner pay back debt in a 1st century prison? In Matthew 18:21-35 there is a prison that debtors go to payback their debts. Is this done by working there? Were some people there already slaves? Verse 30 of Matthew 18 speaks of the "man thrown into prison until he could pay the debt." How would he pay it back while in prison? What system did they have in place to pay it back?
The clear questions posed might be worded this way: how, in Roman-era Palestine, would an imprisoned slave pay back a financial debt? The impetus comes from Jesus' parable of the unforgiving servant/slave of Matthew 18:21-35.
It really requires an answer in two parts: first, to explain why the concern of OP's main question would not be in the thoughts of those who first heard this parable; and second, to suggest some response to OP's question itself.
1. Why "paying back debt" in Matt 18:34 is somewhat irrelevant
Part of the point of this parable is that the unforgiving servant, who had his own debt of "10,000 talents" (μυρίων ταλάντων, Matt 18:24) remitted ("forgiven") will not "forgive" the paltry debt that he himself is owed.
According to the ESV Study Bible, 10,000 talents in "today's money" equates to about US$6 billion:
Craig Keener has pointed out that, in any case, "the real worth of the debt in this story may be greater still: 10,000 being the largest single number Greek could express and the talent being the largest unit of currency, Jesus is making the parable particularly graphic." It is so great an amount that "the poor man owes the king more money than existed in circulation in the whole country at the time!"1
It would be a little bit like saying the debt was for "a billion bars of gold bullion!" Anyone hearing the sum would know immediately that the sum was unimaginably huge.
As is often noted in treatments of the parable,2 the "unforgiving-ness" of the servant means that he has condemned himself to live out his days in the company of his tormenters ("torturers", really - τοῖς βασανισταῖς, v. 34), and the one hearing the parable is left to ponder
As (probably) every study of this parable concludes, this is a debt that is impossible to pay back, whether in prison or otherwise -- which leads to our perception of this servant's own ungracious stupidity for failing to show to his fellow-servant the tiniest fraction of the mercy that had been shown to him (Matt 21:27, "The lord of that servant, being moved with compassion, released him, and forgave him the debt.").
2. Was debt repayment from prison possible anyway?
This leaves unanswered OP's question: "What system did they have in place to pay it back?" I have just three brief notes here; others might be able to elaborate further: