My advice is don’t. It’s a minefield.
I’m not proposing that one cut off all contact with the opposite sex. I’m also not saying that couples can’t be friends, or that coworkers when in a group setting can’t share a beer to celebrate the end of a project or something, or at a party chat with someone of the opposite sex. I’m talking about a real friendship where there are frequent exchanges (phone, in person, whatever).
At some point there’s a very real risk that the relationship will cross a line. And I don’t necessarily mean sex, but rather intimacies that really should only be reserved for husband and wife.
All marriages have their ups and downs, and it would be very tempting in a down period for one of the spouses to confide in an opposite-sex friend stuff that really should not escape the confines of the couple. And when that line is crossed, it’s a very slippery slope that leads to, at the very least, emotional infidelity, and possibly more.
There’s a line in the marriage vow about “forsaking all others”. Sometimes we think that we can avoid crossing the line, but we can all be tempted, and it can often catch one by surprise. It’s called a “near occasion of sin” in the old parlance, but something that still holds some truth today.
Also, when an opposite-sex friend marries, you have to let them go and leave them room for the marriage to flourish. It’s hard, but when one truly cares about a person, perfect love requires that we put what’s best for them ahead of our own desires, even those desires that seem to us to be innocuous.