Marriage is certainly hard, and it's amazing to me how many people enter into it thinking otherwise (myself inlcuded). Affairs are all too common these days, often starting in one's thoughts before being brought to fruition.
Having a successful marriage also starts in the mind. What you tell yourself about your spouse and your relationship affects the way you think about, act toward and feel about him. If you're thinking negative things, then your interactions, thoughts and feelings will tend to be negative also.
It can be hard to change this, and it takes time, but it can be done. I would suggest counseling. If, for whatever reason, you can't do that, then often a church minister, pastor, bishop, etc. can help get you on the right track.
It all starts with you and the effort you're willing to put into saving your marriage. You can't change your spouse, but you can change the way you react to him and what you tell yourself about him.
This is a hard, complicated subject, so I can't really give you step-by-step advice here. But I hope I've given you a direction. Good luck to you!