You need to end the relationship with this person you work with immediately. You need to then go to your husband's friend in total humility and with your heart on your sleeve and tell your husband's friend that you broke it off, that what he did was a wake-up call and made you realize how reckless and...
Best answer: You need to end the relationship with this person you work with immediately. You need to then go to your husband's friend in total humility and with your heart on your sleeve and tell your husband's friend that you broke it off, that what he did was a wake-up call and made you realize how reckless and stupid you were being, how much you f*cked up, and how much you love your husband. Don't make excuses. Do NOT make excuses. Thank him for doing that for you, for giving you the chance to pull your head out of your @ss, that it may be the greatest favor anyone's ever done for you, and while you know he did it for your husband, not you, you nonetheless feel gratitude towards him.
Tell him how angry you are at yourself, that that isn't you. You never imagined yourself doing it. Tell him that you did it not because you loved the guy or even really liked the guy because he's actually kind of a tool but just because you liked the attention, the rush of it, no good reason. Tell him how ashamed you are that you were so weak, that you let yourself be drawn into such superficial and destructive crap.
But all that's over! You tell him in all sincerity that you want to save your marriage, that you NEED to save your marriage--for your kids, for your husband, and for yourself! Share with him that you're deeply afraid that if he tells him now or forces you to tell him right now, in the heat of this moment, that it will irreparably break your marriage, break your family, and destroy his best friend, your husband.
Trust me, no friend wants to deliver this news because he runs a good chance of losing your husband as a friend because in situations like this, we guys often kill the bearer of bad news, but don't tell him that--just know that he's thinking that, that he's actually scared sh*tless of telling your husband, which is why he came to you and not to him.
You tell him that you will tell your husband but when the time is right. You need time to return your relationship to a place where it can bear the strain of this news rather than be shattered by it. Tell him that if he forces the situation, it can only absolutely destroy your marriage because your husband won't ever be able to trust you again because he'll know you only told him because you had to, and maybe you don't deserve that trust, but you've got to try to preserve it nonetheless or your marriage will undoubtedly fail, for trust is the cornerstone of marriage. You tell him that if he wants, you will tell him when you tell your husband and assure him that when you do, you will leave his name out of it. He will want that.
Apologize profusely to this friend of your husband for putting him in this terrible position and fall upon his mercy. Tell him that you will do whatever it takes to prove to him that you've broken it off with this guy--if that means quitting your job to prove this guy is out of your life, then quit your job and find a new one. Tell him that you will also ask your husband to go to couples therapy, that maybe in that environment, you can find a path to honesty that won't completely obliterate the trust in your marriage, that your marriage can come back from. Remind him how much your husband loves your kids and how if this isn't handled carefully so that it leads to divorce, how much it will hurt him and hurt the kids to have to split up custody. Make him see the devastation of hastily telling your husband about something that is now over.
In reality, you may never tell him. They say the truth will set you free. That's bullsh*t, unless their talking about setting you free from your marriage. Some secrets are better to take to your grave. Some truths do more harm then good. Unburdening that truth on him leaves him with the burden carry, a burden you alone should carry and live with. If you forsake the sin, it might be best to put it behind you and never speak of it again.
The more time you can buy with your husband's friend, the longer you can keep him from telling him, the less and less likely he will tell him because then he becomes increasingly unable to explain why he didn't tell him and becomes increasingly complicit.
You might also try making this friend of your husband's your friend. Lean on him for support, like he's the only one you can talk to about this, about all the guilt you feel. But if you make him your confessor, take care to not reveal to him more than he already knows. If he only knows about a few incidents or a couple months, not a year long affair, leave it that way. Invite him over more. Do more to encourage his friendship with your husband. Give him an active role in helping keep you two together. Get him on your team. Become best couples friends with him and his wife or girlfriend. If he thinks he is helping save his friend's marriage, he will be satisfied and will not feel like he's betraying his friend by not telling him.
Your other option is to lie to his friend. Tell him that you've told your husband when you haven't. Tell him that you and your husband had a huge and massive fight that went all night and into the morning and that it was touch and go but you have decided to work through it for the kids. The thing about guys is, your husband will only tell his friend about your cheating if it's the reason you're splitting up. If you stay together, he would never tell his friend. It's too personal. He'll be embarrassed about it. He wants to keep up appearances. He wants to look like he has his sh*t together. He doesn't want to look like he has a wife who's made a fool of him, who's messed around on him. That's emasculating. And even if that isn't what your husband would actually do, that's so much how guys react to situations like this that his friend will think that's what he's doing. If his friend believes he knows about your affair but your husband doesn't talk about it to him, he will NEVER bring it up to your husband. He'll take the tack of "if he doesn't want to talk about it, I'm not going to make him." Plus, if he brings it up, the expected response from your husband would be, "WTF?! You knew about it and didn't tell me!!!" Your husband's friend will be afraid to say he knew in fear that your husband will think that not saying anything was an act of betrayal and that he's been laughing at him behind his back all this time while he's been fronting while secretly going through all this sh*t. Basically, your husband's friend has no real way of verifying that you've told your husband without great personal risk to his friendship, so if you do a very good job of making your husband's friend believe you told your husband, he'll never bring it up. Even if your husband one day says something like "I know my wife has always been faithful," he will still not say a word because he'll think your husband is fronting, and even if he suspects he's been had, he's back in the boat of not having told him for however long.
So tricking your husband's friend into thinking you told your husband and that you're going to work it out but that you did him the favor of leaving his name out of it is a viable option because your husband's friend hasn't thought far enough ahead to realize that in that scenario he has no way of verifying you actually did without asking your husband straight out, which can only blow up in his face in a possibly friendship-ending way if it turns out you did tell him.