This story is part of a series for people who have already read the book and want to think more deeply about the plot and ending. Major spoilers for “The Midnight Library” are ahead.

Over the past year-and-a-half, as the coronavirus pandemic drop-kicked plans and routines somewhere far, far away, I’ve had a recurring daydream about what would have been.

I think about the people I would have met at restaurants that instead shut down, the slices of cake I would have ordered for dessert and the contemplative walks home. The sea turtles I would have squealed about on vacation. The jokes I would have laughed at, or maybe even told. The trillion big and little things I would have stressed over or been excited about.

It’s all lost to the ether. And the magnitude of that is staggering, given that a life can be determined or redirected by a single event.

Matt Haig’s magical novel “The Midnight Library” is a tonic to anyone who tumbles down this rabbit hole of what-if thinking. It’s about Nora, a young woman who decides she isn’t cut out for life. She just lost her job and cat, has fallen out with her brother and best friend and generally assumes she’s a giant disappointment. So she decides to die.

After attempting to end her life, Nora wakes up in the Midnight Library: an immense space filled with shelves of books that stretch endlessly. She’s greeted by her school librarian, Mrs. Elm, who was always kind to her. While she’s in the Midnight Library, Mrs. Elm tells her, she’s preserved from death; this is an opportunity to decide how — and if — she wants to live. Everyone’s life could have gone an infinite number of ways, and each book in the library contains the story of that life. Nora can visit as many as she wants to find out what her life would have been like if she had made different decisions.

“If you really want to live a life hard enough, you don’t have to worry,” Mrs. Elm tells her. “The moment you decide you want that life, really want it, then everything that exists in your head now, including this Midnight Library, will eventually be a dream. A memory so vague and intangible it will hardly be there at all.”

The first few lives Nora tries on are those that absolve her biggest regrets. What if she had never given up swimming, the sport her father was desperate for her to continue? It turns out she would have made it to the Olympics, and her dad would still be alive (in her “root life,” he died young). But in this new version of life, he’s married to a woman he met at a swim meet, whom he left Nora’s mother for, likely accelerating the jilted woman’s death.

What if she had married her fiance, Dan, instead of calling off the wedding two days beforehand? She’d be living with a mean alcoholic who couldn’t stand that she knew more than him — and who was cheating on her to boot.

What if Nora had moved to Australia with her best friend instead of bailing to stay behind in England? She’d still be there, but her friend would have died in a car accident. If she had become a glaciologist? She’d be very cold and almost eaten for lunch by a giant, menacing polar bear.

If Nora’s band had signed with a recording label, we learn, she would have made it big — really big. But her brother would no longer be part of that band. He’d be dead of an overdose.

Not all of the parallel, or perpendicular, lives Nora tries on are so meaningful: In one, she argues with people on Twitter all day. In others, she’s a travel vlogger, a chess champion, a vegan powerlifter. She’s a cat-sitter; she’s on her third husband and already bored. She drops into new lives, again and again, awaiting the one that makes her want to stay.

Toward the end of the novel, Nora visits what is clearly the best alternative life: the one in which she says yes to the coffee date with Ash, the cute surgeon who pops up in her root life and then again in others. I hoped, each time I saw his name, that Haig was hinting the two would end up together. And indeed, in her visit to this lovely life, Nora is married to Ash, with whom she has a daughter, Molly. She’s professionally fulfilled — writing a book on her favorite philosopher — and about as content as one could hope. It’s here that the fundamental problem with her root life dawns on her: “She had loved no one, and no one had loved her back.”

Yet — and this is one of my favorite parts — there are problems with this seemingly perfect existence. When Nora tries to visit Mrs. Elm at a senior living center, she runs into the old man she lived next to in her root life, whom she helped with prescriptions and shopping. In this new life, he’s at the care home he had so passionately resisted. “She was the only difference between the two Mr. Banerjees, but what was that difference? What had she done?” As Mrs. Elm reminds her: “Never underestimate the big importance of small things.”

On her way home, she spots Leo — the boy she gave piano lessons to in her root life, calming his penchant for trouble — in police custody. He has no idea who Nora is and has never taken music lessons. And there we have it: Nora’s root life, the one she so despised, had a purpose after all.

When Nora lands back in the Midnight Library, it’s ablaze — and she’s on the pendulum between life and death, swinging dangerously close to the end. She begs, pleads, shouts at the universe to keep her alive. And finally she wakes, gasping, at home, summoning all her energy to ask her neighbor (Mr. Banerjee!) to call for help.

In the days that follow, after she’s released from the hospital, Nora mends her relationship with her brother and her best friend, and makes plans she’s excited about. The messy life she had tried to exit now seems “full of hope.” It’s a perfect ending: Nora didn’t need a new life. She just needed to realize that her own had potential, and that she could keep reinventing herself until she achieved happiness. Really, who doesn’t need to hear that?

One of the reasons I love to read is because it quiets my mind. I was so engrossed in “The Midnight Library” that I stopped worrying about deadlines and small annoyances and bigger fears. Even days later, when my mind darted to the would-have, should-have, could-haves, I was able to redirect. Call it the Haig effect: Why squander energy on imagining some other life? It would be different, yes, but that doesn’t mean better. As Nora realizes, “It is not the lives we regret not living that are the real problem. It is the regret itself. It’s the regret that makes us shrivel and wither and feel like our own and other people’s worst enemy.”

Maybe you already knew that regret is a waste of time; I hear it constantly. But it’s easier to buy when you recognize that all those other outcomes would have come with their own problems. That’s what Haig so beautifully demonstrates. We tend to romanticize other variations of our lives — we would have no cares in the world, if only we had done this and that differently. Haig’s response: Of course we would. Different packaging; same us. The only thing we truly need to change is the one thing we have complete control over: our outlook.

As Nora muses: “It is quite a revelation to discover that the place you wanted to escape to is the exact same place you escaped from. That the prison wasn’t the place, but the perspective.”

It turns out, I didn’t need a midnight library to shift my own perspective. I just needed a single book.

Angela Haupt is a freelance writer and editor.