If you think you're headed for divorce and have a lot of debt between the two of you, it might make sense to file for bankruptcy before starting a legal divorce proceeding. Filing bankruptcy first can simplify the divorce by clearing out some of your debt. This can make it easier to negotiate how the remaining debts should be divided, and protect you from your soon-to-be-ex's bankruptcy filing down the road.
Also, you and your spouse might want to consider filing a joint bankruptcy before the divorce. Not only will this make the final division of any remaining debts even easier, but filing a joint bankruptcy is cheaper than filing two separate ones.
In either event, bankruptcies and divorces have serious impacts on each other, especially with respect to your property and personal finances.