When you take your marriage vows, the last thing on your mind is the possibility that it could all collapse one day. All too often, though, that’s what happens. We should all be prepared for the worst-case scenario because if you’re not it will get a whole lot worse. What happens when you have no money and you must declare bankruptcy–when you’re simultaneously in the middle of a time and energy consuming divorce? Here’s what you need to know if you think this might someday happen to you.

How bankruptcy affects divorce depends mostly on the type of bankruptcy you intend to file, and that itself largely depends on what you hope to gain from it. A Chapter 7 bankruptcy means that your assets will be completely liquidated, and the resulting funds will be used to pay off any outstanding debts. Chapter 13 bankruptcy means that you, as the one in debt, will be responsible for drafting and submitting a detailed plan to pay off your debt based on income you’ll obtain in the future.

Regardless of which option you choose, you won’t be eligible to make good on any domestic support required of a divorce settlement. If you go down the Chapter 13 route, then you may be eligible to fulfill other divorce settlement obligations. Chapter 7 won’t allow for the same. This means the timetable for your divorce and bankruptcy might change. In reality, you can’t do both at the same time, and you’ll have to choose which takes priority.

If you plan ahead for a Chapter 7 bankruptcy, it can be done with all haste. It will take a few months for both you and your soon to be ex to file a Chapter 7 together in order to take care of whatever debt you can. After that’s taken care of, the divorce can proceed. If you don’t want to file together, then perhaps it is better to wait a while.

Jointly filing a Chapter 7 can also help you spend much less money during the bankruptcy process, which can lead to a less stressful divorce later. Filing fees and lawyer fees can add up. There is a possible impediment to this option, however: if your joint income passes a particular threshold, you won’t be eligible for Chapter 7 at all, and you’ll have to divorce first if you still wish to exercise that option.

A Chapter 13 bankruptcy is a much longer process and sometimes drags on for many years. Most people don’t want to be stuck in a dismal marriage for that long, so it’s probably best for everyone if you proceed with the divorce first.