Generally speaking, bankruptcy is the safer option.
Bankruptcy provides you with the protection of the Courts. That means that all telephone calls, letters, lawsuits, and garnishments have to stop. This is called the automatic stay and it is a matter of federal law. In debt consolidation, your creditors have to agree to the proposal of the debt consolidation company. Sometimes those creditors don’t agee.
Bankruptcy can also allow you to discharge up to 100% of your debts right away, while debt consolidation will always require at least some payment. And even if you do have to repay some of your debts in bankruptcy, typically all of the interest on your general unsecured debts like credit cards and personal loans stops at the moment you file. Debt consolidation can’t guarantee any of these things.