In 1912, after he lost his bid for reelection, William Howard Taft mused about what the country should do with its ex‑presidents once they leave the White House. “A dose of chloroform,” he proposed, to protect the nation “from the troublesome fear that the occupant could ever come back.”

Today, the Twenty-Second Amendment limits how often a president may come back. The question concerning Barack Obama is not what should be done with him, but rather, what should he do with himself?

For most of our history, ex-presidents who were not independently wealthy had to work—not until 1958 did Congress pass a law granting them a pension. George Washington became the country’s largest whiskey producer. John Quincy Adams won a seat in the House of Representatives and fought slavery. And William Howard Taft! Good thing no one took him up on the chloroform. Nine years after he left office, he was appointed chief justice of the Supreme Court, a position that the presidential historian Doris Kearns Goodwin says gave him “probably the happiest decade of his life.”

At 55, Obama will be one of the youngest ex-presidents, and—despite the defeat of his intended successor, Hillary Clinton—a popular one. He is in good health and could easily live for another four decades, which is a long time to be ex-anything.

What can he learn from Jimmy Carter, Bill Clinton, and George W. Bush, who likewise walked out of the White House as vigorous middle-aged men?

The downshift from presidency to post-presidency has bewildered quite a few former White House residents. Having lost in a landslide to Ronald Reagan in 1980, Jimmy Carter left Washington an unpopular one-term president. When he and Rosalynn returned to Plains, Georgia, they found the family peanut business $1 million in debt, and their house in need of repairs.

“The forest in their backyard had crept up to their back door, literally,” says Mark Updegrove, the director of the LBJ Presidential Library. The former first couple spent their first weeks back home hacking away at the overgrowth and making the house habitable.

The chore was an apt metaphor for Carter’s predicament as, at age 56, he sought a path forward. “He said, ‘Look, the actuarial tables said I’m going to live another 20 to 25 years. I want to stay productive and figure out something else I can do with myself,’ ” says Phil Wise, a vice president at the Carter Center.

Jon Meacham, who has written several presidential biographies, believes that most of the clues to a president’s life after the White House can be found in his past. “What drives them, post-presidency, is their essential personality,” he says. “They are—finally, at last—free to be whatever they want.”

From early on, Carter, a Naval Academy graduate who taught Bible studies on the submarine where he served, displayed a striking mix of ambition and idealism. In office, his Baptist faith was fodder for jokes. Out of office, however, it fueled his redemption. “He often talked to me when he was president about how, when it was over, he wanted to be a missionary,” Carter’s vice president, Walter Mondale, told me.

The particulars of a given presidency also come into play, of course. How did the president fare in the White House? Was he reelected or defeated? Did he feel satisfied with his legacy, or haunted by unfinished business? For his part, Carter sought to build on his greatest presidential triumph, the peace accord he brokered between Israel and Egypt at Camp David. To that end, he created the Carter Center, an institution from which he could act as a freelance diplomat and launch further global pursuits.

Over the past three decades, the Carter Center has monitored more than 100 elections around the world. It has effectively eradicated guinea worm disease in Africa. Carter has mediated prickly diplomatic disputes and won a Nobel Peace Prize. In the process, he has redefined the post-presidency, transforming it into a humanitarian and philanthropic venture. “He’s made it difficult for absolutely everyone who’s come after him,” says Michael Duffy, a co-author, with Nancy Gibbs, of The Presidents Club. “Because who can keep up?”

In fact, Carter’s missionary zeal has done more than inspire envy; it has caused his successors headaches. Unfettered by the constraints of the White House, he has found his post-presidency the ideal pulpit from which to push his peace agenda. When George H. W. Bush was building a coalition to oust Saddam Hussein from Kuwait, Carter lobbied members of the United Nations Security Council to vote against U.S. policy. When it appeared that North Korea was trying to develop nuclear weapons, Carter traveled there as a private citizen and told the country’s leader, Kim Il Sung, that the U.S. would take the threat of sanctions off the table. President Clinton was furious.

Bill Clinton began thinking about his post-presidency the day he became president, according to Joe Conason, the author of Man of the World, a biography of Clinton. But nothing prepared him for his first day out of office. Newly resettled in Chappaqua, New York, Clinton ventured to the local deli for a cup of coffee. A crowd of reporters surrounded him, demanding to know why, on his last day in office, he had pardoned the fugitive financier Marc Rich.

“Suddenly, there was no phalanx between him and the media and the public,” Conason says. “He felt powerless. He felt unprotected.” And alone. Hillary Clinton was starting her new job as the junior senator from New York, Conason notes. “So he holed up in his house, not knowing exactly what to do.”

After a few desultory months, the Marc Rich controversy faded, and Clinton ventured back into the spotlight. “Bill Clinton, since he was a little boy, wanted more, more, more,” Jon Meacham says. “Whether it was power, knowledge, women, or good works—it goes both ways, light and dark.”

The light: Through the Clinton Foundation, he got sugary drinks out of public schools and funded relief programs after the tsunami of 2004 and Hurricane Katrina in 2005. He poured money into hospitals in Africa, particularly in Rwanda (he is haunted by his failure to stop the 1994 genocide there). The dark: Early on, he jetted around with, and received money from, billionaires with sordid reputations. The Clinton Foundation raised $2 billion for charities, but some donors—the Saudi royal family, Blackwater—raised eyebrows.

Bill Clinton was also, of course, the first to fully realize the post-presidency’s promise as a global moneymaking operation. Since 2001, he has earned some $150 million for speaking and writing books—prompting Michael Duffy to observe to me: “Being president is a good career move.”

If Jimmy Carter and Bill Clinton seemed to cling to the vestiges of the presidency, George W. Bush happily shook them off. In a 2010 interview with Texas Monthly, he told Mark Updegrove that when he woke up in Crawford, Texas, on January 21, 2009, he opened the newspapers and was delighted to realize that the stories inside were no longer his problems: “So I gathered up [my dogs,] Barney and Beazley, got in the pickup truck, drove over to my office, and started writing anecdotes for my book.” James Glassman, who was then the director of the George W. Bush Institute, recalls a private dinner at Bush’s home in 2010, during which Condoleezza Rice and Karl Rove chatted about the upcoming elections. Not Bush. “He was not the least bit interested,” Glassman told me, laughing. “It was stunning how little attention he paid to the political world.”

Today, Bush mostly stays close to home, taking part in activities he enjoyed before his political life—barbecues with his neighbors, golfing, riding his mountain bike. He has occasionally traveled to Africa, where his institute has renovated health clinics and expanded programs to fight cervical cancer. “He seems content because he is content,” says Peter Wehner, a former speechwriter for Bush who stays in touch with his former employer.

Indeed, Bush could be the poster child for a happy second act. Uninterested in either burnishing his legacy or remaining at the center of the political swirl, he has discovered what midlife researchers suggest is the secret to fulfillment: shifting away from ambition and acquisition and toward activities that have lasting and intrinsic worth, such as investing in important relationships and causes or hobbies that give joy and meaning to one’s life.

As has been widely reported, after leaving the White House, Bush developed a passion for painting—dogs, himself, world leaders. Now he has turned his eye to military personnel who served in Iraq and Afghanistan, some of whom returned wounded. Sixty-six of these portraits will appear in a book to be published in February. When I asked Wehner whether Bush might be working through his decision to invade Iraq, he shook his head. “The painting is a way to honor the veterans,” he says. “I don’t think there’s any deeper meaning, that there are dark elements that were somehow manifesting itself in art. It’s possible, but that doesn’t strike me as the kind of person he is.”

On January 21, what can Barack Obama expect? He surely will not enjoy the buoyant landing he once anticipated. The defeat of Hillary Clinton, for whom he campaigned hard and often, has cast a deep shadow over his final weeks in office. Before he was elected, Donald Trump vowed to unravel many of Obama’s achievements.

Even so, for reasons of temperament and popularity, Obama may be spared the anxieties that dogged some of his predecessors. Douglas Brinkley, a presidential historian, says that while the electorate may have rejected some of Obama’s policies, it has not rejected him. He compares Obama’s situation to that of Dwight D. Eisenhower, who left office a popular two-term president, even though his intended successor, Vice President Richard Nixon, had lost the 1960 election. Barack Obama’s response to leaving the White House is perhaps most likely to recall Bush’s, friends and observers say. In part, that’s because, despite their vastly different politics and personalities, the two men have a similar relationship with the presidency: They don’t need it.

Unlike so many politicians before him, Obama did not aspire to the presidency early on. For years, points out David Maraniss, who has written biographies of Obama and Clinton, Obama did not settle on a particular career path. Rather, he engaged in a “struggle to figure himself out” as a mixed-race man in America, a struggle that included traveling to Kenya, organizing poor residents on Chicago’s South Side, and writing a literary memoir. “He’s just an unusual character to be president,” observes Doris Kearns Goodwin. “The fact that he’s a writer means that he looks at himself from the outside in. There’s a self-awareness and a reflection that is not common among politicians.”

Valerie Jarrett, Obama’s close friend and senior adviser, says he doesn’t yearn for the spotlight: “Of course he’ll miss being in the thick of things. But I think he’s also really grounded and pragmatic. So he won’t indulge the emotion of saying, ‘Oh gosh, I wish it wasn’t over.’ It’s over.”

Which isn’t to say that Obama is likely to spend the rest of his days bodysurfing. Jarrett and others believe his feeling of social obligation will be a source of direction as he goes forward. Obama’s sense of calling to service is key, Jon Meacham says. “It’s a lot like Carter—that we’re here for a purpose,” he said. “It’s our duty to do as much good as we can, as the scale of our life allows.”

Obama will undoubtedly spend some time raising money for his presidential library in Chicago, and writing his presidential memoir, for which he is expected to receive a multimillion-dollar advance.

But what else?

For several years, Obama has ruminated about his next phase with dinner guests including Steven Spielberg and Reid Hoffman, a co-founder of LinkedIn. Before November, the possibilities seemed endless, ranging from addressing racism or criminal-justice reform or gun control or climate change, to buying a basketball team, to teaching law, to joining a tech firm. Advancing the social and environmental issues close to his heart may be harder now—but he may also view the effort as more important.

Regardless, he will have to manage a challenge more quotidian, but hardly simple—an emptying nest. “Family is everything to Obama,” David Maraniss says. “His whole young life was a search for home—for a sense of family, place, and identity.” A man who grew into adulthood without a father, he seems to define himself as much by his constancy as a dad as by his political achievements. Most nights that he is in Washington, he walks upstairs at 6:30 to dine with his family. When politics at home and war abroad created minute-by-minute upheaval, his family was his anchor.

Now, in an inevitable cruelty of midlife, his girls say they prefer sleepovers with friends to movies with Dad. “They break my heart,” Obama has said. He wore sunglasses to Malia’s graduation from Sidwell Friends School in June, so no one would see him cry. The prospect of losing his girls to adulthood, friends say, saddens him more than leaving the White House.