If President Trump wants to bounce back from his rocky start, he would do well to follow Bill Clinton’s example. (Robert A. Reeder/The Washington Post)

Watergate. Obstruction of justice. Impeachment. The Saturday Night Massacre. It’s tempting to label Donald Trump the second coming of Richard Nixon. Yet the brash Trump’s presidency might have more in common with those of two other presidents — the pious, Sunday-school-teaching James Earl Carter Jr. and the charismatic libertine William Jefferson Clinton.

All three men ran as outsiders, determined to disrupt and fix the broken machinery of Washington politics. They all brought with them a team of loyal aides unfamiliar with the folkways of Washington, and ran into immediate trouble because of misplaced loyalties to problematic men that weakened their ability to govern. Each also struggled to master the legislative process. And all three were ideologically rough fits for their party coalitions — leading to internal strife and difficulty enacting their agendas.

Although Trump shares these similarities with Carter and Clinton, his predecessors’ presidencies diverged as they progressed and point to two potential outcomes for the current president. If Trump emulates the stubborn Carter, who refused to learn how to play the game, it could doom his presidency. If, however, he mimics the flexible Clinton, who learned from his mistakes, he may yet flourish.

While Trump pledged to “drain the swamp,” Carter similarly positioned himself during the 1976 campaign as an antidote to the polluted atmosphere lingering after Watergate. He set the bar high, promising, “If I ever lie to you, if I ever betray you, then I want you to leave me.”

Transforming this pledge into a governing strategy, however, proved difficult. Carter relied on his loyal “Georgia mafia,” staffers such as Hamilton Jordan and Jody Powell who shared their boss’s lack of familiarity with the ways of Washington. By initially acting as his own chief of staff, Carter opened direct access to the Oval Office to his staffers, which hamstrung his ability to efficiently make decisions.

Carter’s loyalty damaged him far beyond producing inefficiencies. Early in his presidency, Bert Lance, one of Carter’s closest friends and director of the Office of Management and Budget, became entangled in a scandal about financial impropriety in his past banking dealings. Although smart politics dictated having Lance resign, Carter stood by him, characterizing The Washington Post’s stories on Lance as “a vendetta.”

Although Lance eventually would be cleared of all charges, Carter’s loyalty deeply wounded his presidency. The Lance imbroglio diminished his public standing and subjected the administration to weeks of distracting coverage that hampered Carter’s ability to advance his agenda.

Even without such distractions, enacting his agenda would have been difficult for Carter, because he struggled to master the legislative process, even with the benefit of a Democratic Congress.

Carter, a conservative budget hawk, failed to grasp the need to sometimes yield on smaller fiscal matters in the name of building relationships with key legislators. When a water project bill came up for renewal, Carter attempted to remove some provisions he considered wasteful pork. This maneuver, and others like it, alienated important men such as Senate Finance Committee Chairman Russell Long, whose support Carter needed to pass his signature agenda items. This fundamental lack of understanding about the transactional nature of Washington politics repeatedly flummoxed the self-righteous Carter.

The next Democratic president, Bill Clinton, confronted a similar array of organizational problems, loyalty conflicts and legislative obstacles.  His appointment of boyhood pal Mack McLarty as chief of staff proved to be a significant blunder, as McLarty was simply too nice and lacked the ability to instill order in the West Wing. He allowed too many voices in the Oval Office, which clouded the president’s decision-making process.

Clinton also got in trouble by appointing Arkansas friends Webster Hubbell and Vince Foster as associate attorney general and deputy White House counsel. Hubbell resigned a year into the job, soon to plead guilty to criminal charges, while Foster committed suicide. Both created a cloud that hung over Clinton’s administration, with Foster’s suicide unleashing a firestorm of conspiracy theories that plagued Clinton for the rest of his presidency.

The legislative process also tripped up Clinton, costing him the biggest agenda item of his first two years in office. Rather than asking Congress to write legislation that achieved his vision for health-care reform, Clinton empaneled a White House committee headed by first lady Hillary Clinton. Because key members of Congress had no ownership of the byproduct, they had zero incentive to bend to the will of the White House and abandoned the bill when it became politically toxic. Clinton compounded this blunder with intransigence, including an ill-advised threat to veto any bill lacking universal coverage, which torpedoed his remaining chances for passing health-care reform.

Like Carter and Clinton, President Trump has struggled early in his presidency because of staffing issues, misplaced loyalty and a failure to master the nuances of the legislative process.

He, too, has suffered from a weak chief of staff and too many people with access to his office. Trump’s advice comes from three conflicting corners — the New York team of Jared Kushner and Ivanka Trump, the far-right populist duo of Stephen K. Bannon and Stephen Miller, and the mainstream conservatives such as Reince Priebus.

President Trump’s loyalty to Michael Flynn, his first national security adviser, compounded this White House chaos, igniting a firestorm that threatens to engulf Trump’s presidency. Although aware that Flynn’s baggage made him politically toxic — especially for a president who promised to drain the swamp — Trump still appointed him to the critical position, with its access to classified information. Amid controversy, Trump continued to defend him as a “good guy.”

Like his predecessors, Congress has bedeviled Trump. As Republicans in Congress labor to reach consensus on how to repeal and replace the Patient Protection and Affordable Care Act, the president has conveyed constantly shifting messages about what he wants, reducing the incentive for congressional Republicans to take a tough vote (after all, they can’t be sure that the president will have their backs).

Those are the similarities. But Carter and Clinton present two possible paths for the remainder of President Trump’s term.

Carter stubbornly refused to adjust course until it was too late. He alienated most of the key Democratic constituencies, which prompted a damaging primary challenge from Ted Kennedy. The weakened Carter proved no match for Ronald Reagan in the 1980 general election.

Clinton, by contrast, realized his problems after a drubbing in the 1994 midterm elections delivered Republicans unified control of Congress for the first time in 40 years. Clinton had already reshaped his staff, replacing McLarty with veteran Washington insider Leon Panetta, who brought newfound order to the White House. For the rest of his first term, Clinton deftly navigated between conciliation and confrontation with the new Republican Congress. He shut down the government rather than swallowing cuts to social welfare programs that he found draconian, but he compromised on welfare restructuring, increasing the minimum wage and other areas that produced bipartisan achievements. This course correction propelled Clinton to reelection, while Carter’s unyielding approach made him a one-term president.

Like his fellow outsiders, Trump finds himself faced with an important choice. He can continue to be an outsider — undermining his party’s legislation, lobbing Twitter bombs and creating chaos in both domestic and foreign policy — or he can adjust to the ways of Washington, which will lead to far greater success.