Federal bankruptcy laws govern how companies go out of business or recover from crippling debt.
A bankrupt company, the "debtor," might use Chapter 11 bankruptcy of the Bankruptcy Code to "reorganize" its business and try to become profitable again. Management continues to run the day-to-day business operations but a bankruptcy court must approve all significant business decisions. Some big Chapter 11 filings have included K-Mart, WorldCom, and Enron. A Chapter 11 case is extremely complicated and not a do-it-yourself filing. Consult with an attorney who is experienced in Chapter 11 filings to sort out the numbers, restructuring, etc.
Under Chapter 7 bankruptcy, the company stops all operations and goes completely out of business. A trustee is appointed to "liquidate" (sell) the company's assets and the money is used to pay off the debt, which may include debts to creditors and investors.