When a debtor asks to become bankrupt. The court must approve this and assets are sold to pay debt.
https://thelawdictionary.org/bankruptcy-petition/