The ancient solution was the expectation that someone who was unable to pay his debts to another would work as a slave to that person until the debt was paid off...
That tried and true ancient solution has fallen from favor, unfortunately, which contributes massively to the problem.