This is the general rule, but there are certain exceptions, including if you file bankruptcy.
If you file bankruptcy and your debts are discharged, that does not create income for you that you have to pay income taxes on. It is in the Internal Revenue Code, 26 U.S.C. Sec. 108.