Most retirement plans, including IRAs, have options which allow early withdrawal, even if you cannot borrow from it. In most cases, once the money is withdrawn, you have to treat the withdrawal as taxable income in the year taken out, plus typically a 10% early withdrawal penalty, if you are under 59 1/2.
By cashing out retirement plan assets, you can pay off debt. Beyond the tax consequences though, you should consider that you are giving up part of your safety net and taking away money you could use more in the future. Right now, money in a deferred savings account like an IRA is still available for emergencies in the future.
If you can hang onto it and let it grow, it will be there for your retirement. These are things that improve your future outlook. Using this money for paying off old debt is backward-looking and means a future with fewer options.
State laws and bankruptcy protect almost all retirement accounts, including IRAs and 401(k)s from almost all of your creditors now, and you should not lose them if you file bankruptcy.
So why give that money to creditors who couldn’t take it away otherwise? How close are you to retirement? How long do you want to put off retirement?
Again, which version of bankruptcy depends on your situation — but you have a better chance of relying on your 401(k) or IRA being there when you retire.