Bankruptcies and divorce seem to go together. You need to consult with your divorce attorney, but usually we find divorce attorneys prefer that couples file bankruptcy, either separately or together, before they file for divorce. The reason is that by eliminating the debts there is less to fight about in the divorce. On the question of which goes first, bankruptcy or divorce, most divorce attorney prefer the parties file bankruptcy first.
You can save money by filing together even if you are living apart so long as you are still legally married. However, filing bankruptcy together is fraught with potential conflicts of interest and can be frustrating if the your spouse fails to cooperate. You might be able to file separately even if your are married so long as you your spouse’s income does not cause you to flunk the income tests for filing Chapter 7. These tests are different (easier to pass) if you two have lived separately for six months or more. This area can get complicated.