WASHINGTON — “When I meet a woman wearing a ring on a chain around her neck, I know immediately: member of the club,” Sheryl Sandberg said. “I never noticed before.” That club in question would be the unenviable one for people whose spouses have died.

“What I loved about the chain was that I could put both our rings on it,” Elizabeth Alexander added. But these two club members, who met recently for breakfast, have more in common than jewelry.

Ms. Sandberg, 47, the chief operating officer of Facebook and author of “Lean In,” the best-selling and highly influential book about overcoming the barriers that women face at work, was widowed young. In 2015, her husband, Dave Goldberg, died at 47, while exercising, leaving Ms. Sandberg with two young children.

Her story mirrors that of Ms. Alexander, 54, an acclaimed poet and essayist, and President Barack Obama’s inaugural poet in 2009. After 15 years on the faculty at Yale, she is currently a professor at Columbia and the director of creativity and free expression at the Ford Foundation, overseeing its grant making in arts, media and culture.

In 2012, Ms. Alexander’s husband, Ficre Ghebreyesus, died at 50, also while exercising. The couple also had two young children at the time.

Now, both women have written best-selling books about those losses and their aftermath. Ms. Alexander’s memoir, “The Light of the World,” was a finalist for the Pulitzer Prize in 2016. Ms. Sandberg’s book, “Option B: Facing Adversity, Building Resilience and Finding Joy,” written with Adam Grant, was published in April. It weaves the story of Ms. Sandberg’s tragedy into those of others, along with social science research, in a practical guide to the inevitable hardships of life.

Over a breakfast of English muffins and cappuccinos (with a side of bacon for Ms. Sandberg) at Farmers Fishers Bakers in Georgetown, the women discussed the impulse to write about their struggles, the experience of parenting through grief, and the value in sharing our deepest stories.

Philip Galanes You two are like amazing reality-show contestants: Handed identical baskets of horrible ingredients, yet you come back …

Sheryl Sandberg With totally different books.

Elizabeth Alexander I was surprised that so shortly after my husband passed, maybe two weeks later, I started writing things down. It felt unseemly, almost cannibalistic.

PG You felt compelled to write?

EA It was the only way I could know what was happening to me. I knew I was alive; I knew I had to take care of my children. But writing was like placing my hand on the earth. It wasn’t comfortable. It was more like living with the steady companion of my life: making things out of experience.

SS That’s exactly how I felt. I always wanted to keep a journal, but never did. I have a box of them from when I was a child. I’d start on January 1st and quit by the 5th or 6th. Then one day I wrote: “I’m going to bury my husband today,” and I didn’t stop. If I didn’t write every day, I felt like I was going to burst. I would walk out of the office, tears pouring down my face, and they would not stop until I wrote everything down: about the flight to Mexico [where Mr. Goldberg died], the way we didn’t go on the hike that last morning, the way they wouldn’t let me into the back of the ambulance with him.

PG Writing was a kind of self-soothing?

EA More like: If you can stay at the bone of what’s true, then that’s your lifeboat.

SS I felt increasingly isolated, just so lonely. I’d drop off my kids at school, and people would stop talking when they saw me. I’d walk into work at Facebook, where everyone talks all day, and there’d be no chitchat. Literally, I could silence any room just by arriving. So, a couple of days before the end of shloshim, the traditional Jewish mourning period for a spouse, I thought, if I was going to write something, this is what I would say: “Stop asking me, ‘How are you?’ How do you think I am? Say: ‘How are you today?’ And get out of the way of ambulances. Because when Dave died, no one moved.”

There was zero chance I was posting this thing. But when I woke up the next morning, it was just so bad. The end of mourning? Are you kidding? I thought: Things can’t get worse, maybe they’ll get better. So, I posted it on Facebook, but I never thought I was talking to the world. I was shocked when it ran as news. It didn’t get rid of the grief, but it changed my life. People started talking to me again. A friend said, “I’ve been driving by your house every day,” but now she stopped and came inside. There are like 70,000 comments on that post. People connected with each other: mothers in NICUs, fathers of suicides. That was probably the beginning of the book, though I didn’t know it then.

EA My experience was a bit different. I was teaching a lecture class that I loved on contemporary African-American art. We talked about coming through the middle passage of being enslaved — through Jim Crow — and the resilience of making art out of that. What it means for black people to be making art today when our young men are so vulnerable. So the possibility of death was something we were dealing with.

After Ficre died and we buried him, there was one class left in the semester. I wanted to go back and give that final lecture. Afterwards, every student — all 75 — lined up and shook my hand or hugged me. Every single one. And making that occasion to connect got that part out of the way. Of course, there were still many times when I felt: Ah, can I go into that room? I’m neon now; I’m different.

PG One of the powerful takeaways from your books is that grief is a form of love; it can’t be rushed. When I’ve grieved, I just wanted to take it off fast — like wet clothes.

SS Same here. I wanted to solve the problem and put a bow on it. But my friend Davis [Guggenheim, the documentary filmmaker] told me that when he starts a film, he never knows where it’s going. He has to let the story unfold. Honestly, I probably still feel like you. I lived through the grief because I had no choice. And as my rabbi told me: “Lean in to the suck.”

EA There’s a poem by Rilke that I quote: “Just keep going. No feeling is final.”

SS I remember reading that, early on, and thinking: “I hope she’s right. But I think she’s wrong.” Now I know you’re right.

EA Like after a bad day, your mother would say, “Go to sleep, you’ll feel better in the morning.”

SS But the days just keep coming. Last week would have been our 13th wedding anniversary. Next week would be the second anniversary of his death. Did anyone ever ask, “Did you write your book too soon?”

EA No such thing. There came a point when the poet in me, this rigorous killer who doesn’t believe in publishing anything until it’s absolutely right, saw: She didn’t die.

SS Wow! “She didn’t die.”

EA My husband’s death ravaged me, but it’s meant to. If we have any life span, we don’t outrun this stuff. It may not be a husband at 47 or 50, but these things will happen. Somehow, we have to let the ravages shape us and make our souls stronger and more beautiful. Because that is life.

SS I think of my mother-in-law. Losing her husband, then losing her son. It’s too much. And she helped me clean. You know the moments: the wedding ring, cleaning out the closet.

EA I thought you were brave to do that with your kids. I did it alone.

SS Trust me, I was advised to include them, so I did.

PG I love that you kept things. I wore my dad’s clothes until they fell apart.

SS Because of the smell?

PG Because they were his. This ratty sweater is going to power me through the day.

SS I have a drawer in my closet for things like that, too.

PG You just touched on the other great theme of your books: motherhood.

SS Exactly. How do I raise a 7- and 10-year-old who just lost their father? I’m a single parent. I don’t have the financial challenges that many single parents have. But I’m doing this alone, and they’re grieving.

PG Were you worried about taking heat as a wealthy woman, the way you did on “Lean In”? “What does she know about regular people?”

SS Not if I could shine a light on the terrible stresses women face: 37 percent of single mothers are living in poverty. With widows, it’s 15 percent — 25 percent if you’re black or Latina. My kids asked me: “Are we going to lose our home?” Do you know how many people for whom the answer is yes?

PG You’ve also taken a strong stand on bereavement leave.

SS I changed Facebook’s policy. It was great before; now it’s better. We’re at 20 days for an immediate family member, 10 days for Grandma. I never did this stuff publicly before, but now I want other companies to do better. The best thing that happened after Facebook announced its policy is that our H.R. director got calls from four other companies about it.

EA One of the things that came into sharp focus for me is that we need to live in villages. I moved to New York after Ficre died because I had friends who are like sisters. I thought: Who will go and pick up my kids? Who do I trust to do these intimate things?

PG I thought it may have been a grief-induced move.

EA No, Ficre died in April, and my friend Amy sat me down in May and said, “I’m going to tell you something, and it’s going to make you cry, and I’m sorry, but you’re going to have to move.” And I said, “Why are you doing this to me?” But I knew she was right. I go hither and yon for my work — not that I could do that immediately.

SS I didn’t feel like I could do that at all.

EA She said, “We will pick up the children.” And they did. They’ve been family to me, and I to them, as well. My parents moved from Washington into our building.

SS My best friend, Marne, took the job as C.O.O. of Instagram. But that summer, they moved around the corner from us. And my sister lives around the other corner. Making villages is an important part of surviving this.

PG Did being a mother change your grief?

SS I didn’t want Dave’s death to ruin my children’s life. And I thought it would. I really did. People ask, “What’s the worst moment of your life?” Well, there are lots of contenders. But it might be telling my children their father died. But Adam [Grant] said to me, “If you don’t stop blaming yourself, if you don’t learn to laugh, if you don’t find joy again, your kids can’t recover.” And when I did feel a little better, my kids told my sister-in-law that they were better because Mommy’s not crying all the time.

EA My kids were paramount for me, too. That didn’t mean keeping a stiff upper lip. But it meant carrying on. It was weird, as if a voice said, “We will survive.” It didn’t sound cheerful about anything on the horizon, but it felt like the truth. And even through the suffering, we had these beautiful men who loved us. What a blessing to have had that. It’s indelible.

SS I still love Dave. I can date someone else. I can laugh. I can have good days and bad days. But I love him every bit as much, maybe more.

EA Yes, he died, but it’s not like he’s not there anymore. What I thought would be terrible for the kids was if they felt they couldn’t talk. So, I made a point of saying, if they asked me a question about the Peloponnesian War: “Oh, that’s a Daddy question.” Or with things that would make us laugh, we could say, “Oh, that’s such a Daddy thing.” We all knew exactly what it meant.

PG After your kids said, “Mommy’s not crying anymore,” was there pressure not to?

SS It’s funny. A couple of days after saying that, my son said, “Why don’t you miss Daddy anymore?” So what I figured out is that I just have to be honest. I cry when I need to cry. And I try to follow them. One of their big things was: “Are you going to die, too?” To this day, there’s more conversation about death in my house than I would like.

EA My kids get anxious if I’m sick, too — even if it’s just a sore ankle.

SS I didn’t leave without them until they told me I could, six months later. They thought if I went on a trip, I would die like Daddy. But kids cycle in and out of grief very quickly: crying and screaming, then playing a game and having a fine time.

EA I don’t know that kids can sustain total grief.

SS They can’t. So, I try to follow their emotions. I’ve always talked about Dave, and they’ve never resisted that. I’ve spoken to lots of people who lost parents as kids. Many of them said it wasn’t just that they didn’t know their parents, it’s that the idealized version that got presented didn’t seem real. Because no one will say a bad word about someone who’s died. So, I beg my friends to be honest. “Do not set them up with a perfect father!” And I encourage my kids to be honest, too. We all have shortcomings.

PG There’s a flip side, too: being kinder to ourselves. Did you have periods of magical thinking? “If only I’d checked the gym….”

EA Oh, yes. If only I’d made him take Lipitor.

PG Then he’d still be alive.

SS I have to work on that to this day. We put up a video on OptionB.org. This woman is telling a story about getting divorced, finding a guy online, going on her first date. She’s all excited. But 10 minutes in, the guy walks out. Her friend tells her: “Well, you’re unattractive and boring. Of course he left.” But, wait! No friend would ever say that. She said it to herself. And when that dawns on you, it’s like: “Oh, yeah, we are really mean to ourselves.”

EA It’s so true.

SS Self-compassion is how we recover. And not just for the things that aren’t our fault. But also for the times when I was so angry — or when I got it wrong with my kids. We have to work on treating ourselves like we would treat our friends.

PG That brings me straight to my final question. It’s no secret that we’re not communicating very well across political and other divides right now. Is there hope in sharing our deepest stories?

SS I’ve thought about this a lot. I’m giving the commencement speech at Virginia Tech this year, the 10th anniversary of the shootings, and it’s about collective resilience. Communities that get through things like that do it together. Because no matter what else we believe, there is birth and love and joy. There is also death by suicide and sudden death and incarceration. We need to create areas to come together, where we can be there for each other.

EA One thing that moved me about the response to my book is that readers came in for love and loss, and they came out having loved some black people. I know there are tough challenges ahead for us. I also know the only choice is to connect. But what’s fractured in our culture is “those people” — what we can do to “those people.” It’s going to be heavy and hard, but like the poet Gwendolyn Brooks, we have to keep coming back to the idea that other people’s children belong to you.

SS Yes, other people’s children. It’s my dream for Option B: to help others help others.