Most of your retirement accounts are fully protected in a bankruptcy case. Any retirement account that is “ERISA qualified” is completely protected by exemptions, meaning that there is no risk that the trustee could take the asset to pay your creditors.
As such, it is almost never a good idea to use retirement funds to try to pay off your debts, risking penalties and fines when you could otherwise protect those funds for when you need them.
For more, check out Can bankruptcy take your 401k or IRA? in Upsolve's Learning Center.