The correct answer is: Don’t marry a jerk in the first place.
To some extent, we’re all jerks (some more than others), but our spouses probably know more about what kind of jerks we are, more than any other human alive. (Other than Christ.)
Scripture does provide for situations where divorce is allowed and sexual immorality or adultery falls into that category. The breaking of the covenant of marriage by one party does not bind the other party into continuing to respect the covenant, but there are appropriate ways of severing it formally, and it is also possible to return together and confess sins to one another for forgiveness.