its an affair , no one gets desperate or needs to have one , there really is no need to do it other than lack of self control and lust really
My parents have been married for 50+ years. When I was a teenager, and they'd been married for a bit less than 20 years, I noticed something was up with my mum. Whatever it was, she took a lot of out on me, including telling me she wished I didn't exist. I've never actually forgiven her for that comment.
Not long after this, I overheard her talking to a friend about what had been going on. Basically she was being bullied at work and her self esteem was at rock bottom. My dad, apparently, was not very supportive. Knowing my mum, she may not have been able to communicate to him that she needed support and he may have been unable to see she needed it. At this time she was actively pursued by a single man. Single in the sense that he was unmarried and had no partner or girlfriend. So she had an affair. At a time when she felt unwanted, unloved and absolutely useless, she lashed out at me, her young teenage daughter, and cheated on her husband.
But I don't think any of this was really about lack of self control or lust. She hit a very low point. She acted appallingly. But is she, on balance, somehow a dreadful person? No, I don't think she is, despite the effect her behaviour had on me. She messed up, badly. She's not a bad person.
So I can understand why the OP is so confused about what to do about her friend. I think only she can really decide whether she needs to cut her friend out, or maintain the friendship but with strict boundaries in place. I wouldn't blame her whichever action she took.