Depending on your financial situation, you can get rid of debts or restructure them. But this doesn’t give you a clean slate, especially on your credit report.
Yes, bankruptcy tanks your credit score in the short term. But how much a bankruptcy impacts your credit score depends in part on how old the record is.