Gwen Stefani and Jennifer Garner are just the latest crop of famous women whose husbands were allegedly involved with their nannies — and it’s a cliché Lauren Weedman knows all too well. The actress had been with her husband, David*, for 11 years when she found evidence of his affair with their teenage babysitter. Here, 47-year-old Weedman — author of “Miss Fortune: Fresh Perspectives on Having It All From Someone Who Is Not Okay” (Plume, out now) — tells The Post’s Lindsay Putnam how her marriage fell apart.

Three months after my husband, David, and I decided to end our marriage in 2013, I was impressed with how successfully our co-parenting strategy was working. Though he had moved out of our Los Angeles apartment, David would visit frequently as we tried to keep things as normal as possible for our 4-year-old son, Leo.

So when David accidentally left his laptop at my place, I didn’t think anything of turning it on. The computer had once belonged to me, and I wanted to make sure I hadn’t left any important videos — such as Leo’s birth — behind. But the oldest video on David’s computer wasn’t one of Leo splashing in the bathtub. It was of our babysitter, Simone, sans clothes — and it was dated 2011, a year before David and I had even gotten married.

David and I first met nearly two decades ago. We were both living in Seattle at the time, and appeared together in a small independent film. He had a beautiful wife, Hannah, and a young son, Jack. It wasn’t until after Hannah passed away from cancer and David and I were both living in NYC that I developed a crush on him — but since I was still married to my first husband at the time, our friendship remained just that.

After my divorce, I moved to LA in 2003 to pursue my acting career — and, as luck would have it, David and Jack moved to Santa Monica, Calif., not long after. For the first time, we were both single; it wasn’t long until a few theater dates turned into a full-blown romance.

But I always wondered if I measured up to his widow, Hannah, and constantly sought validation from David to try to soothe my anxiety.

“You know, it just hit me: If we end up staying together, you will go down in history as the great love of my life,” I told him one night after four years of dating.

I was hoping for a moment straight out of a romantic comedy, where he would call me the love of his life, too. Instead, all I got was an “Aww.”

But after six years of dating, I pushed David to have a baby. I was 40, and knew that this was probably my only shot at becoming a mother.

We had Leo the next year. David offered to stay at home with the baby; he loved being involved, and he was an amazing father. As the primary breadwinner, I continued to take on new acting roles — mostly theater gigs, but also occasional small parts on popular shows including “True Blood,” “New Girl” and “Masters of Sex.” When Leo was 1, David recommended we hire Simone, an 18-year-old aspiring actress whom he mentored. She would show up in low-cut tops and miniskirts, but I thought that was just because girls are so overly sexualized in Southern California. When a friend of mine told me that she had spotted them together in the street, I assumed that they were discussing her career.

David and I eventually made our union official and got married in 2012, when Leo was 1½. I thought I had the perfect little family. But David grew increasingly distant. He’d go on long bike rides and disappear for hours. After months of tense, one-sentence conversations, I snapped.

“You keep telling me that you’re ‘happier than you’ve ever been in your life’ being a stay-at-home dad, but you seem so unhappy. At least with me. I can’t take it anymore. Listen, David, if you’re not happy, if you don’t want to be married, then let’s split. We’ll be good co-parents. We’ll…”

“Yes. I think we should,” David interrupted before I could even finish my thought.

Our marriage was over, less than two years after it began. And three months later, I knew the real reason why.

When I found the video, I couldn’t even scream, as Leo was in the room. I’d always pictured catching a husband in an affair as a dramatic scene complete with the slashing of car tires. Instead, I called Simone and left a voice mail: “You’re not babysitting today. You’re never babysitting Leo again.”

It’s every woman’s nightmare, and it can happen to anyone — just look at Jennifer Garner and Ben Affleck. It comes down to the fact that this whole manhood thing is tough. Feeling like a man, being a money earner, being the one who takes control — I thought they were clichés. But they’re true. Men think that they want to have all of that pressure off of them, but once it’s lifted, it can be emasculating to be less successful than your wife.

David, a former actor, was used to being told he’s amazing and handsome. But you don’t get a lot of ego strokes when you’re home with your kid all day. I was always too stressed out by working and parenting to do it for him.

But I should have followed my instincts. Other parents warned me about Simone, but as a feminist who works with at-risk girls, I didn’t want to pass on a new babysitter just because she was overly sexual. I thought she was just a lost, damaged kid. I thought if I didn’t hire her, it would make me look like some old insecure troll. I was trying to prove to David that I was cool.

If I didn’t feel comfortable, I should have just said so, and not cared what anyone else thought.

It’s been two years since David and I split, and he and Simone are still together. It can still be painful but, surprisingly, I’m grateful for the affair. I needed something to completely cut me off from my ex-husband. Otherwise, I would have stayed with him despite his constant unhappiness and the ongoing fighting. I was so committed. But it made me realize that I needed to put my own needs first. So, in some ways, I’m grateful to Simone. I’m grateful to be free.

When reached for comment, David said: ​”​The only thing I would say is that Lauren is a writer and a storyteller who, like many, combines truth with fiction in her art as a way of getting to a deeper truth. I respect her work and collaborated with her on several projects, and support her work as best I can. It makes no sense for me to say what is true and what is not, as I do not believe that is what her work is about; the book is about her truth and is not a documentary. Even though we were not able to be partners we have found a way to be great co-parents to my son and for that I am very grateful and that is the only thing that matters.​”​

*All names except for Lauren and Leo’s have been changed.