Bankruptcy is a way of clearing your debts—which adversely affects your credit—through the court system, whose job is to sort through your assets and forgive what you’re unable to pay. Most of the time, this means giving you a clean slate.