Jealousy is not necessarily a bad thing, or something to be fought like a sin.
It's natural for a man to be repulsed at the thought of another man being with his wife. Marriage being exclusive, for life, is part of the NATURAL LAW written on the heart of every man. That means it doesn't require having the Faith to know this. We don't have to take the Church's word for it, for this particular truth.
Let's put it this way: would a saint happily "share" his spouse with other men? Of course not. There's nothing wrong with wanting your spouse all to yourself. Marriage involves exclusivity, both physical AND emotional. It's part of the marriage contract.
Let's not forget also: marriage is not all bad. It's not all burden (being "for life"), responsibilities and duties. It also comes with privileges. One of those privileges is having your spouse all to yourself. If the negative is having to forsake all others, the positive is that your wife is all yours.
With marriage, like everything else, you have to accept the GOOD with the "bad". It's not all negatives and prohibitions.
Affairs can be emotional as well as physical. And in fact, emotional affairs usually precede the real thing.
The modern world is very lax on the "negative" of marriage -- the forsaking of all others -- but let's face it: it's equally lax on the "positive" of marriage: life long exclusive rights over your spouse's body. Long story short, the Modern World makes a much smaller deal out of marriage, all around. At least it is consistent!
You can't cherry pick one aspect of the Modern World's philosophy without inviting the other as well. How can you expect your spouse to be faithful for life, if you won't give him/her your all?
I would say that if you have friends of the opposite sex who say things like "you're hot" or "you're beautiful" then you need to trim some of your friends from your Facebook friends list. Hearing things like that will be a temptation at least, and the beginning of a downfall at worst. Women are naturally vain and like to hear compliments. Meanwhile, given human nature and the natural course of things, married couples usually lose that "newlywed fervor" after many years of marriage. Husbands stop complimenting their wives on a regular basis. They are too busy, too accustomed to their wives, etc. And that's a normal "happy" marriage. But many marriages have serious problems, issues, trials, etc. and in those cases, the spouses actually have issues to work out with each other. So you can see how these two realities, taken together, can be a recipe for disaster.
You're arguing with your spouse about X and you're unhappy about many aspects of your life, but muddling through. Then you go to work and this young person of the opposite sex is completely sweet, understanding, listens to you, cares about you, pays attention to you, gives you compliments, respects you, does nice things...
That's how so many adulteries start. It's happened a million times, and it will happen a million more times before the human race is gone.