Oh dear, don't we all want to know! I have heard that the only way to save a totally wrecked marriage is to go to marriage counseling. Sadly (almost always) the men, would not commit themselves to counseling because when it all comes down to it, they don't care enough to go to them and fix their relationships. If your husband (or wife) refuses all sources of marriage therapy, I am sorry to say, nothing can be done.
Some religious groups will tell you that all you need is God. But to tell you the truth God doesn't take part in our lives as much as religious people want to think. 99% of the work needs to be done by you, and at least 50% of the willingness to want to fix it, has to be present.
Sorry you're having problems, I hope you do better soon.
more sex. last time i checked, sex makes everyone happy. and happy people are much easier to be around and enjoy. if sex is part of the problem, it isn't enjoyable anymore or something, well, try something new. multiple times in a day, just focusing on giving your partner a good time, whatever.
being super nice to your spouse can also help. whatever they want, do it. that should make them happy and want to do nice things for you. and if it doesn't, well there are huge problems.
more time together can also help. dates, evenings out, romantic things.
it depends on what your spouse likes. if they like gifts, do that. if they like things being done for them, do that. if they like sex, do that. if they like time together focusing on each other and talking about life, do that. the last one more women seem to like than guys. and if you're the guy, spending more quality time with your wife should be good.
Act like it will survive. Act like you want it to. Talk. Talk through all the "unsafe" subjects; the things you currently avoid talking about now.
Go through the motions of a couple in love. The actions tend to invoke the emotions. Put your spouse's wellbeing above your own. Do things that show you are more focused on your spouse's wants and needs. Show that you value them above your own wants and needs.
To save your marriage, you have to increase your giving. If you are unwilling to do that, then give up. Selfish self-centered people cannot maintain a marriage. If that describes either one of you, then there is little hope of keeping the marriage viable.