It's not rocket science, actually if you can remove the emotion (I know, easier said than done) then it's much easier in a lot of cases than you may realize. Just remember that pretty much everyone wants the same basic things from a marriage: companionship, love and respect. How we go about asking for those things, or showing those things, can vary from culture to culture and among genders, but that's pretty much it.
Most of the time when a marriage is falling apart it's because one or both of the spouses don't feel like their needs are being met. We often boil marriage troubles down to sex, but sex is really only a 'by product' of the basic need to feel loved.
So, step one to pull your marriage back from the brink is to try to objectively analyze the way you and your spouse treat each other. Do you talk to each other with respect most of the time (we all have our bad days when we're a little rough around the edges and may take that out on others, as long as these days are kept to a minimum it's not that big of a deal) or do you talk to your spouse like you hate their guts?
Once you've thought about it you may realize that you take a lot of your general frustrations out on your spouse. If you've figured that much out all you have to do is talk to your spouse, explain that it isn't about them and that you are sincerely sorry for taking the day to day aggravations you face out on them. Follow that apology up by making sure you stop doing it.
That one simple thing can make a ton of difference in a lot of relationships. If the behavior has gone on for a long time, it might take more than this to fix things. If it's gone on for a long time it's likely that both of you are now in the habit of talking to each other that way, that can lead to a lot of built up anger and hurt which will take longer to work through.
If that's the case you may want to ask "Amy Waterman" for her advice and help walk you through the healing process; And help each of you re-train yourselves when it comes to communicating. It may take some time to 'unlearn' your bad communication habits and learn new ones.
There are a lot of things that can go wrong in a marriage, and just as many ways to fix them. But in almost all cases it will boil down to poor communicating. Some simple changes in the way you and your spouse talk to each other may be all you need to save your marriage.