The next US president, no matter who it is, could learn something from the UK about leading a divided country

British PM May smiles while meeting with Spain's acting PM Rajoy at the Moncloa Palace in Madrid Thomson Reuters For several months leading up to today's ballot, Donald Trump has taken to calling himself "Mr. Brexit," predicting that his brand of grassroots populism ultimately will win out over an out-of-touch political class.

Now that election day is upon us, it is certainly possible that Trump will pull off such an upset, even if most experts expect that Hillary Clinton - the "establishment" candidate - will squeak by to become America's 45th president.

But whether Trump wins or loses his bid for the White House, Britain's recent vote to leave the European Union will still hold lessons for the U.S.

Indeed, the real lessons of "Brexit" will become apparent not on election day but starting the day after, when the person elected to be the next president of the United States turns to the unenviable but critical task of putting the country back together.

A bad hangover

Just as Americans will on Nov. 9, Britons woke up on June 24 as a nation divided. Following a bitterly fought and at times ugly referendum campaign - one marred by accusations of racism, lies, fear-mongering and even the fatal shooting of a pro-European MP - the country narrowly voted to leave the European Union by a margin of just 52 percent to 48 percent.

Few experts had predicted the U.K. to embrace Brexit. The pound and the stock market tumbled on the news. Regional leaders from London, Scotland and Northern Ireland (all of which returned majorities in favor of remaining inside the EU) questioned not only the wisdom but also the legitimacy of the result.

Worst of all, nobody seemed to be in charge. Prime Minister David Cameron announced his resignation, leaving Britain with a lame-duck head of government and no successor in sight. Even the opposition Labour Party, which should have benefited from the turmoil in government, became paralyzed as the party's MPs launched an attempted coup against their leader, Jeremy Corbyn.

Britain's Prime Minister David Cameron wipes his eye as he addresses a news conference during a European Union leaders summit in Brussels March 20, 2015.REUTERS/Francois Lenoir

Whoever wakes up as president-elect will face a similarly fraught political situation: A badly polarized electorate, the two main parties threatened by internal division and ominous question marks over the legitimacy of the country's democratic system.

But as a political scientist who studies politics on both sides of the Atlantic, I'd argue that post-Brexit Britain can offer Americans at least a glimmer of hope. For under the leadership of Theresa May, who in July became David Cameron's successor as prime minister, Britain has been pulled back from the brink of political crisis even as the government continues to grapple with the enormous challenges of carrying Brexit forward.

Where May has led

The biggest lesson from May's short tenure in office is that a unified and confident political party is still the best vehicle for effective government in hard times.

Upon becoming prime minister, May artfully averted the self-destruction of the Conservative Party (which many observers regarded as inevitable in the eventuality of Brexit) by offering top-level cabinet positions to members of both the pro- and anti-Brexit wings of her party.

May has not been shy about throwing red meat to Conservative traditionalists in order to shore up party unity. She has acquiesced to controversial education reforms that are popular among the Tory right, for example. But the prime minister has also made high-profile efforts to woo non-Conservative voters, especially traditional Labour supporters, to whom she has promised a raft of pro-worker and pro-consumer reforms. These include a pledge to retain (and enhance) all workers' legal rights currently guaranteed by the EU.

Queen Elizabeth II welcomes Theresa May at the start of an audience where she invited the former Home Secretary to become Prime Minister and form a new government at Buckingham Palace on July 13, 2016 in London, England. Former Home Secretary Theresa May becomes the UK's second female Prime Minister after she was selected unopposed by Conservative MPs to be their new party leader. She is currently MP for Maidenhead.Dominic Lipinski - WPA Pool/Getty Images

The result of this blend of party management and electoral outreach is that both May and her party have been riding high in recent opinion polls. May has returned Britain to "politics as usual" in four short months, allowing the country to focus on matters of public policy and not constitutional crisis.

Even the question of how to manage Brexit has been somehow "normalized." Withdrawal from the EU is still a bitterly contested issue, of course, and the government was dealt a heavy blow when the High Court ruled that Parliament must be given the final say over initiating Brexit. But at least these questions are beginning to be resolved through the fabric of established political institutions. Given how unstable things looked in late June, this achievement is no mean feat.

President Fix-It

The challenge for Clinton or Trump will be to emulate May by swiftly restoring order to U.S. politics with the aid of a disciplined party organization. This means that whoever wins will need to mollify their radical co-partisans but also give their party a truly national and broad-based appeal by addressing the needs of the country at large.

It is clear that Clinton is a more likely candidate to succeed at this difficult balancing act, especially if the Democrats make big gains in the House and Senate.

Like May, Clinton is a coalition-builder in the traditional mold. She is someone who sees the value in offering potential adversaries a seat at the table instead of bludgeoning them into submission. For evidence, one need only look to Clinton's skillful handling of Bernie Sanders, who surely tested her patience by refusing to drop out of the Democratic primaries earlier than he did.

A monkey wearing a tee shirt with the characters "King of prediction" holds a card which reads "elected" between cardboard cutouts of Hillary Clinton and Donald Trump Reuters

In contrast, Trump has shown little interest in knitting together a broad base of support for himself within the Republican Party. Despite his reputation as a deal-maker, Trump has treated compromise as a sign of weakness. He settles his political disputes by silencing his opponents, not by conciliating them. And if the Republican nominee has been poor at placating skeptics within his own party then he surely has little chance of reaching out beyond his base after the dust has settled.

In fact, the enormous damage that Trump has inflicted upon the Republican Party might turn out to be Clinton's biggest political asset if she emerges as the next president. Like Prime Minister May, who could hardly hope for a more ineffective adversary than Labour leader Jeremy Corbyn, a President Clinton would face an opposition that has no claim to the political center ground. Conservative writers already predict a period of lengthy introspection following a Trump defeat.

Clinton is thus fairly well placed to assert leadership beginning on Jan. 20 despite her stubbornly persistent unpopularity among some segments of the electorate. Trump, on the other hand, will have to make up for lost ground if he wins today's contest. He will urgently need to unite his party, lay the groundwork for an inclusive governing coalition and show respect for established institutions and processes. There will be no time to lose.

Because while Trump clearly revels in calling himself "Mr. Brexit," what America will really need is a "President Fix It" - a leader capable of bringing healing through the slow and unglamorous business of effective government. The next president could do far worse than to look to Theresa May for inspiration.