In many countries a company or business can "file for bankruptcy protection" so that creditors cannot destroy all of the physical capital and goodwill by breaking it apart and moving it away. All this provides is more time to work out a new deal between the owners and the people the business owes money.
An individual person who owes debt and cannot pay it can also "declare bankruptcy". That person will lose all but some basic things they own, but all the debt will go away. Normally they cannot easily borrow money again for years.
Very often, a creditor threatens a debtor with debt slavery, if the debtor does not know that they have a right to go bankrupt. This is a human rights problem in very many countries. Also, some creditors continue to bother a debtor even though bankruptcy laws say they should not, hoping that the debtor will pay them money they might not otherwise get.