If you and your spouse are thinking about getting divorced, it may be the right time to also consider filing for bankruptcy if you have a hefty amount of debt between the two of you. Filing for bankruptcy before divorce can help simply the divorce proceedings by clearing out some of your debt. This can make it easier when it comes to negotiating how the remaining debts should be divided, and also protect you should your future ex-spouse file for bankruptcy not too far down the road. It's also cheaper to file one joint bankruptcy than to file two separate actions.
Keep in mind that when one or both spouses file for bankruptcy, all community property--anything bought or acquired during the marriage--becomes a part of the bankruptcy estate. All property owned at the time the bankruptcy is filed becomes part of the bankruptcy estate, with only certain limited exceptions.
Negotiating a property settlement once bankruptcy is ongoing can be complicated. Debts related to property settlements are typically considered "nondischargeable" in bankruptcy proceedings, which means the debtor can't simply have those debts wiped out by filing for bankruptcy. The debtor will still be personally liable to pay for those debts. In some situations, debtors can potentially have the court wipe out those debts if they can prove: (a) That he or she can't take care of him or herself and any dependents if required to continue paying the debt, or (b) That wiping out the debt would provide greater benefit to the person filing the bankruptcy than any harm done to his or her former spouse or child by nonpayment of the debt.
One method of protecting yourself during divorce negotiations if you have reason to believe your spouse may be contemplating filing for bankruptcy is to take out a security lien as backup to debts your spouse is supposed to pay you after the divorce. You'll want to put the lien on property your spouse will be awarded in the divorce. Later, if your spouse asks the bankruptcy court to discharge the debt he or she is supposed to pay, you can seize the property to pay off that debt.
Another form of protection should you believe your future ex is planning for bankruptcy post-divorce is to have a "hold harmless" or "indemnity" clause included in the divorce decree, requiring your spouse pay certain debts or repay you if a creditor comes after you for that debt. This way, if your ex-spouse later files for bankruptcy and the credit comes after you for the money, you can ask the bankruptcy judge to enforce the indemnity agreement between you and your ex. While this won't 100% guarantee you'll get paid, it is one more item that the bankruptcy judge will consider.
Whatever you decide, you should probably at least consult with a bankruptcy attorney as soon as you know you're likely going to file for divorce, and that filing for bankruptcy is also a possibility. You definitely want to have someone on your side to help put you in the strongest financial position post-divorce possible.