Here’s the challenge that the Brexit vote poses now for world leaders

The day of the Brexit vote, a friend remarked: "My head says remain, but my heart says leave." Based on the turnout and closeness of the final vote, it appears that many Britons were likewise torn between their heart and their head and that both were making good arguments.

The "head" argued that Britain had benefited from the trade, market access, and investment that followed from European Union membership. This meant jobs, economic growth, and prosperity for the British people. Exit is, in many ways, a leap into the unknown. No country has left the EU before. Global precedents are scarce as well. For example, 162 nations have joined the World Trade Organization in the last six decades — none have left.

Military leaders argued that the EU provided an important pillar of national security. Others argued that membership made it easier to work, study, and travel throughout Europe.

The "heart" argued that the sovereignty of the British people was being eroded as a far-away, unaccountable bureaucracy in Brussels, was passing rules governing an increasing array of everyday life. By some estimates, nearly one in five U.K. laws originated from the EU, including nearly half of those with a significant economic impact. The inability to set reasonable limits on immigration was the most obvious manifestation of this loss of control.

The argument that Britain, the fifth largest economy in the world, the country that birthed modern day representative democracy, could exert as much or more influence on the global stage, spoke to the legitimate pride of all who call the United Kingdom home.

There were, of course, many other arguments on both sides. But on election day, leave prevailed.

In the days and weeks ahead, British and EU leaders will need to resolve how to execute Britain's exit. British leaders will have to determine what comes next, including trade and the relationship with continental Europe.

At the same time, it appears likely there will be demands in other EU countries to conduct exit referendums. And within the UK, there are already calls for another referendum on Scottish independence.

The challenge for elected leaders the world over is how to address the very real excesses of government and the occasional negative impacts of the liberal world order — and by that, I mean the mechanisms through which the world has expanded free trade, international cooperation, and security — while preserving the benefits.

The benefits of international engagement are quite real. Academic economists Scott Bradford and Robert Lawrence in 2004 estimated that a return to the illiberal trade rules of the 1930's would leave the world 7 percent poorer. With the threat of terrorism on the rise, the ability of freedom-loving people to confront and defeat terrorists requires more, not less, international cooperation and engagement.

But the excesses and downsides of international engagement are also real. Abiding by supranational trade and economic rules means a relinquishment of some sovereignty. Confronting global security threats has come at a cost of blood and treasure; and the costs have been especially high for the U.S. and Britain. While globalization and free trade result in greater economic prosperity overall, there are disruptions and losses for real people. Similarly, while immigration can be a net positive, unfettered immigration creates genuine problems, including a sense of lost community.

These issues will be front and center in the presidential election in the United States this November. If in the United States, Europe, and across the globe, those of us who believe in trade and international engagement are seen as unwilling or unable to confront and correct the excesses and downsides of those policies, the voters may feel they have no choice but retrenchment, even if retrenchment means a leap into the unknown.

People take such a leap with the hope that one big change in policy or leadership can set everything right. Yet usually the outcome is disappointing as we discover that in confronting what we disliked, we managed to throw the proverbial "baby out with the bath water."

Articulating to the "head" the benefits of trade and engagement is no longer sufficient. Leaders must communicate to the "heart" that they are prepared to address the sense of loss people feel. Simultaneously, they need to speak to the aspirations all of us hold in our heart, aspirations not just for a better future for our children and grandchildren, but a future in which they have the ability to control their own destiny.

The days, months, and years ahead will largely be shaped by whether or not elected leaders can show us a path where our heads and our hearts can speak with one voice.

Commentary by Eric Cantor, the former House majority leader, who served as the U.S. representative for Virginia's 7th congressional district from 2001 to 2014. He is currently vice chairman and managing director at Moelis and Co. Follow him on Twitter @EricCantor.

For more insight from CNBC contributors, follow @CNBCopinion on Twitter.