An actress with an obsessive work ethic, Messing is learning to make a cake onstage in “Birthday Candles” on Broadway.“Birthday Candles,” the existential dramedy now in previews on Broadway, relies on a simple recipe: an eight-step process for a golden butter cake. At every performance, the actress playing Ernestine, the show’s Everywoman heroine, bakes that cake onstage, in real time.Here, in Roundabout Theater Company’s production, that actress is Debra Messing, which means that “Birthday Candles” depends on yet another recipe: Find a Hollywood star. Rehearse. Repeat.If you’re wondering whether Messing is a baker, let’s just say that when she tried out the recipe during the first wave of the pandemic, the cake exploded. She had added nearly two cups of baking powder, rather than nearly two teaspoons.“It took me two days to clean out the oven,” she recalled in an interview. “I can honestly say that the baking has become the thing that I am most nervous about.”Considering that Messing never leaves the stage, and that Ernestine ages 90 years — from 17 to 107 — in 90 breathless minutes, this is saying something.MESSING, A 53-YEAR-OLD ACTRESS who marries daffy comedy to a ramrod work ethic, was speaking on a recent afternoon in an upstairs lounge at the American Airlines Theater, where “Birthday Candles” opens April 10. She wore a purple sweater and a surgical face mask, with her famous red hair mounded on top of her head — less of a bun than an entire gâteau.John Earl Jelks, left, with Messing in the play, which opens April 10 at the American Airlines Theater.Sara Krulwich/The New York TimesAs Messing tells it, she has always been hungry: “to act, to learn, to progress.” Taken to “Annie,” a musical about a spunky redhead, as a 7-year-old, she decided that acting was for her. Even then, she took her craft seriously; the following summer, she played a blind girl in a play at camp and insisted on rehearsing with her eyes closed. She walked off the stage and into the orchestra pit. It was the first of many workplace injuries to come.Messing wanted to be a musical theater performer, a triple threat. Her dancing, she said, is merely adequate, so she tops out at a double threat. After college at Brandeis and graduate school at New York University, she talked herself into a lead role on the sitcom “Ned and Stacey.” Michael J. Weithorn, the creator, hadn’t thought that she came across as Jewish enough or neurotic enough. But Messing is, by her own proud admission, both of these things.“Happy neuroticism,” said Vivienne Benesch, who is directing “Birthday Candles” and has known Messing since graduate school. (Benesch has a lot of memories from those days; one involves a unitard.)“Ned and Stacey” ran for two years. When it ended, Messing booked “Will & Grace,” a sitcom about a gay lawyer (Eric McCormack) and his best friend, a straight interior designer (Messing). Though a conventional network sitcom, “Will & Grace” was a milestone for queer representation, and it allowed Messing to refine her gift for dizzy, kinetic physical comedy.“She’s not afraid to show up and fall over things in service of the story,” McCormack said in a phone interview, as he was recovering from emergency dental surgery — but still wanted to speak about his friend.McCormack also confirmed her reputation as something of a workaholic. “That is her strong suit,” he said. “She will delve.”When the original run of “Will & Grace” ended, in 2006, Messing starred in a mini-series, “The Starter Wife,” that later came back for an additional season. In 2011, she heard about a new musical drama, “Smash,” a brainchild of the playwright Theresa Rebeck and Steven Spielberg that was planned for Showtime before it moved to NBC.“I was like, ‘I have to be part of this,’” Messing said. “I am going to be able to play a character where I watch people sing and dance all day long.”She was cast as Julia, the book writer of a Broadway-bound musical about Marilyn Monroe. Rebeck recalled being glad to have her, saying: “She’s extremely beautiful. And she’s funny. She’s fearlessly funny.” (Rebeck also said, perhaps less generously, that Messing had a lot of input in Julia’s controversial, scarf-forward wardrobe.)Despite a strong pilot, “Smash” splintered. Messing blamed the firing of Rebeck after the first season, but problems had surfaced earlier. When it ended, after two seasons, Messing went to Broadway for John Patrick Shanley’s oddball romantic comedy “Outside Mullingar.” She played a detective on “The Mysteries of Laura,” another show that didn’t last for long. Then “Will & Grace” was revived — something Messing preferred not to discuss. When it finished in 2020, after three seasons, she was ready for Broadway again.“Birthday Candles,” by Noah Haidle, premiered at the Detroit Public Theater in 2018. A year later, Roundabout, which has a long relationship with Haidle, greenlit a cold reading. Haidle requested Messing because, he said, “She’s good at acting and a very famous person.”Messing, who listens to the “Birthday Candles” script as she falls asleep, said, “Doing the work gives me peace.”Kholood Eid for The New York TimesBenesch, the director, sent the script to Messing, who read it on her bed, laughing, then crying. She arrived for the reading more prepared than anyone Haidle had ever seen. Afterward, Todd Haimes, Roundabout’s artistic director, said that he wanted the play for Broadway. But it seemed as if there were other plays contending for a slot. So, to sweeten the deal, Messing sent him a cake, with sprinkles and “Let’s Do It” written in icing.Had she baked it?“Oh, hell no,” Messing said. “I wanted him to say yes.” The next day, he did, but then the pandemic pushed opening night back a couple of years.THE PLAY, WHICH GESTURES toward modernist classics like Thornton Wilder’s “The Long Christmas Dinner,” takes place on a single set: the kitchen of a middle-class home in Grand Rapids, Mich. Ernestine enters as a teenager. “I am going to be a rebel against the universe,” she says. “Wage war with the everyday.”When the lights go down 90 minutes later, she is a great-great grandmother, reconciled to the universe. In between there are births, death, comedies, tragedies. Every scene takes place on one of her birthdays and the golden butter cake is baked continuously, without benefit of a mixer. (They’re too loud.)During the pandemic lockdown, Messing caught up on “Real Housewives” shows and attempted the ukulele. She also studied the script for “Birthday Candles.” Some parts came to her easily; she identified with the young Ernestine’s passion and expansiveness. The breakdown of the middle-aged Ernestine’s marriage, her experiences of loss — these resonated, too. But what Ernestine undergoes later is unfamiliar. “I haven’t experienced any of it yet,” Messing said.She watched YouTube videos of centenarians: studying how they moved, how they sat. She also worked with a voice coach to learn about what happens to the larynx as women age. Ernestine never leaves the stage, so there are no prosthetics or wigs. Aging, then, is effected through body and voice, plus subtle changes in hairstyle and eyewear.“I’m not 107,” Messing said. “I don’t know anyone who’s 107. So part of it is trusting that the homework will protect me and support me.”It’s working, for Haidle anyway. “Whatever she’s doing,” he said, “it’s like a magic trick.”Part of this trick: Messing listens to the script every night while she sleeps. (“So intense,” Haidle said.) This, she believes, helps her learn lines. It also makes her feel that she is doing her utmost. “Doing the work gives me peace,” she said. “I don’t know if it’s helping or not, but putting it on and falling asleep to it, I like to think that it’s getting embedded in a deeper way.”Nothing about her approach seems light. Typically, actors move through technical rehearsals casually. But during a recent one — as Messing and a co-star, Enrico Colantoni, worked through a scene — she seemed to give a full performance for each pass. She even wanted him to do a real kiss.“Kiss me,” she insisted. “Kiss me, come on.” Under her sweater, blue this time, she was wearing a pain relief patch, because hunching over as a 107-year-old, as she had done in rehearsal the day before, had put a lot of strain on her lower back.Baking has required extra preparation. It’s a science, Messing said, and science was never really her thing. It doesn’t help that each stir, crack and sprinkle is precisely timed to Ernestine’s milestone events.“The milk is the thing that really just makes me want to go to a sanitarium,” she said.But Messing has practiced — and practiced, and practiced — and she believes that by the time the play opens, she will be able to bake the cake comfortably, reliably linking each step to Ernestine’s sweet and bitter journey through life.Still, there are limits. “Frosting?” she said. “Forget it.”At home, she has finally made the cake successfully and marveled at how humble staples — butter, sugar, eggs — combine into something astonishing, a moment of transcendence wrested from the ordinary. So even though allergies and intolerances and an eating plan she adopted around the time she turned 50 mean that Messing avoids nearly all of the ingredients, she tried a bite.“I was like, This is so delicious,” she said. “I was like, Oh yeah, I get it.” More