When you're in a financial hole that is so far down that there seems there's no escape, there is one final option: bankruptcy. Bankruptcy is a way of legally stating that you cannot pay the debts that you've accumulated. The result of this declaration is that your creditors can no longer attempt to collect money or property from you directly. Effectively, bankruptcy allows you to "wipe the slate clean" in some respects - you will no longer be legally bound to pay certain debts after filing for bankruptcy.
There are five primary results to filing for bankruptcy. The first is, as mentioned, is that it can wipe away previous debts. This is known as discharging - but be aware that not all debts can be discharged. A nice side effect is that it'll stop annoying and harassing calls from creditors. Second, bankruptcy can stop wage attachments, which are when a creditor gets a legal order to take money from your paycheck to pay a debt. Finally, it protects your future interests, meaning that any new property or money you own is safe from creditors.
As noted above, not all debts can be discharged. For the most part, any unsecured debt can be discharged - unsecured debts are ones that are not backed by property, such as credit cards. Secured debts, such as car loans and home mortgages, are attached to property, and can be repossessed by a creditor. Other debts that cannot be discharged include: alimony and child support, student loans, debts resulting from fraud, tax bills, and any debts accrued after filing bankruptcy.
Bankruptcy is not without its downsides, however. While bankruptcy in itself will not lower your credit score, bankruptcies remain on your credit report for 10 years. It can be extremely tough to be granted credit after a bankruptcy, but it is possible. That decision is up to the lender.