ASK your partner what they want, and what they think is failing.
Asking alone will show your partner that you aren't just going to give up, and can renew their hope in the relationship, and in you.
Work On The Things Which Damage Your Relationship - On the surface it may seem as though money is the issue in your relationship, for instance.
But in reality it could be more than that, it could really be both partners' inability to handle stress or pressure that is the true issue.
THUS, you need to work on the damage from the inside out, because the problems in a relationship ALWAYS stem from insecurities, emotional instability, and fears.
Work through these things with your partner, and ask him/her to be open about it.
Gain Emotional Stability - It may seem impossible to gain emotional stability during a time like this, but you will find that it can be a life saving tool to utilize.
You start by doing everything in your power NOT to display your emotions, and NOT to react to situations.
This will require a lot of self control, but you will find that when you gain emotional stability, it helps your partner to come down and become stable as well.
Decide On A Plan Of Action Together - Right now, your spouse is waving a divorce ultimatum in your face, because they don't know what else to do.
BUT, that does not mean that they are not open to any other option here, which is why you should confront your partner with the idea of a plan of action.
What this is, in essence, is a plan that both you and your partner create together to try and work through things.
By asking your partner what they would like to see and how they would like to see it, you in essence do what you normally never do: you listen, understand, and problem solve.
Admit Your Mistakes - Your spouse wants to know that you are aware that you make mistakes, and they need to know that you are aware that you hurt them.
The divorce is their way of telling you that you have crossed the line one too many times with your actions, and that they are not going to take the same things from you again.
Let them know this, and he/she will feel less inclined to divorce you.