Should a married person have a close friend of the opposite sex?
The Bible does not forbid close friendships between men and women. As Christians, however, there are some principles that we would be wise to heed. Married people especially need to be wary of friendships with members of the opposite sex because temptations are more likely to arise when there are marital problems. If a man's best friend is a woman who is not his wife, he is likely to share these problems with her, which can lead to an unhealthy emotional attachment.
Most married men (or women) who have affairs purposely go out to find a romantic interest outside of their marriage. So many people say, "I didn't mean for it to happen; it just happened." These things "just happen" when we put ourselves in situations that are difficult to control. When a man has a wife who is not necessarily very attentive to his needs, he could easily feel that he has fallen in love with another woman who does give him this attention he craves.
Even a marriage that is built on a foundation of faith in Christ and has relatively few problems is not immune to extra-marital temptations. This is why the Bible does not tell us to stick around and try to fight temptation, but to flee from it like we do from all "youthful lusts" (2 Timothy 2:22). Trying to fight temptation seems to become especially difficult when it comes to matters of the heart or the lusts of the flesh. First Corinthians 6:18 tells us that we need to run away from sexual sin, because it is much easier to run away from temptation than to stay and fight it.
Married men and women should carefully avoid putting themselves in compromising situations when it comes to the opposite sex. If they are seen together in public, it will give the wrong impression. If they are alone on the phone or in person, they will subject themselves to the temptation of an emotional or physical affair. The Bible tells us that everything we do should be for the glory of God (1 Corinthians 10:31), so the wise thing would be to stick to visiting as couples or "double dating" with other married couples, as opposed to risking the complications associated with close friendships with the opposite sex.