That process is called "Article 50." Like much in the E.U., it's a little confusing and certainly complicated. Worse still, no one has ever gone through the process before.
Here's your guide to how that might work.
Article 50 is the legislation that sets out how a member state can leave the E.U. It's part of the Treaty of Lisbon, which was signed in 2007 and went into force in 2009.
What does it actually say?
1. Any Member State may decide to withdraw from the Union in accordance with its own constitutional requirements.
2. A Member State which decides to withdraw shall notify the European Council of its intention. In the light of the guidelines provided by the European Council, the Union shall negotiate and conclude an agreement with that State, setting out the arrangements for its withdrawal, taking account of the framework for its future relationship with the Union. That agreement shall be negotiated in accordance with Article 218(3) of the Treaty on the Functioning of the European Union. It shall be concluded on behalf of the Union by the Council, acting by a qualified majority, after obtaining the consent of the European Parliament.
3. The Treaties shall cease to apply to the State in question from the date of entry into force of the withdrawal agreement or, failing that, two years after the notification referred to in paragraph 2, unless the European Council, in agreement with the Member State concerned, unanimously decides to extend this period.
4. For the purposes of paragraphs 2 and 3, the member of the European Council or of the Council representing the withdrawing Member State shall not participate in the discussions of the European Council or Council or in decisions concerning it.
A qualified majority shall be defined in accordance with Article 238(3)(b) of the Treaty on the Functioning of the European Union.
5. If a State which has withdrawn from the Union asks to rejoin, its request shall be subject to the procedure referred to in Article 49.
Okay. But what does that actually mean?
Yes, the law is deliberately vague, perhaps intentionally — the E.U. didn't really want anyone actually leaving, of course, and no country has ever invoked Article 50.
But there are some basics. First off, there is no set way for a country to decide it wants to leave. The member state seeking to leave can decide that itself. Then it will have to give an official statement to the European Council explaining that it plans to leave.
The country that wants to leave would not negotiate directly with other member states to reach a deal on how it would leave. Instead, the member states would meet among themselves as the European Council and agree on a framework. Britain would then negotiate the technical details with the European Commission. The European parliament also will have a say, giving consent to the deal.
The article also clearly states that a country will have two years to reach an agreement on the exit, during which time the country would still be governed by E.U. treaties and laws, although it will not be allowed in the decision-making process. However, if all E.U. member states agree, that deadline could be extended.
Finally, if the country later decides it wants to rejoin the E.U., it has to apply for membership just like any other nation would.
When will Britain invoke Article 50?
In the past, Cameron has suggested that after a vote in favor of leaving the E.U., he would immediately invoke the article. But on Friday he did not, instead saying that whoever succeeds him as prime minister should make that decision.
It's unclear exactly how long the leadership contest within the Conservative Party to succeed Cameron could take. Cameron has said he will leave by October. Some have also suggested that a general election will be inevitable after the Conservative Party's leadership contest.
Johnson, a likely contender for Cameron's job, has suggested that he agrees with Cameron's decision to delay the use of Article 50.
"In voting to leave the E.U., it’s vital to stress that there’s no need for haste, and as the prime minister has just said, nothing will change in the short term except work will begin on how to extricate this country from the supranational system," Johnson said. "As the prime minister has said, there is no need to invoke Article 50."
But how does Europe feel about this?
European leaders, fearful of the already considerable uncertainty over the situation, have said that they want Britain to enter the process of leaving immediately. On Friday, a number of E.U. leaders issued a statement saying that they expected Britain to invoke Article 50 “as soon as possible, however painful that process may be.”
So why is Britain stalling?
First, there's no rule that says Britain can't stall. In fact, the way the referendum was set up, it could ignore its results completely (more on that later).
There's actually a strategic element to waiting to invoke Article 50. The negotiations with the E.U. are expected to be very, very hard. Many European leaders will want to punish Britain for leaving by offering it a bad deal. If no deal is struck within the two years and no extension granted, Britain will essentially revert to having no deal with the E.U., instead using World Trade Organization (WTO) rules for trade.
"It would be sensible for the U.K. to work out its negotiating position and construct its negotiating team before setting the clock running," Alan Renwick, deputy director of the University College London Constitution Unit, wrote in a blog post this week. "The government might also hope to hold preliminary discussions with other member states — though how far they would be willing to engage at this stage is unclear."
Wait. Britain could ignore the results of the referendum?
Yes, given the way the referendum was set up, it is not legally binding. Cameron could have legally said "I disagree" with the vote to leave and simply carried on in Europe.
Such a move may well have been political suicide, of course, and given the fact that Cameron has announced that he will resign, it seems very unlikely he would do that.
Britain's Parliament could also vote to block leaving the E.U. (another move made unlikely by political considerations, however). They may also seek to influence the deal Britain strikes with the E.U., potentially moving Britain away from some of its harder demands toward something more accommodating of European viewpoints.
Are there any other options?
Pro-Brexit groups had suggested that Britain could invoke Article 48 of the treaty, which allows for E.U. treaties to be revised. However, member states would almost certainly block this move.
A more realistic, though still unlikely, scenario is that Britain could simply repeal the 1972 European Communities Act and withdraw from the European Union unilaterally. It'd be a drastic move, however, and put Britain in a bad position for negotiating new deals with the E.U.