Hi, I did my Master's on this so I may spin off into tangents here and there but bear with me.
Okay, the Egyptian government had been trying to get the British to leave for some time (some might argue all the way back to 1882...) and the progress being made was slow, to be kind. The British did not want to give up the airbases and naval bases in Egypt; they had already been losing other formal colonies (such as India) and was risking a diminished role in the wider geopolitical climate. Additionally, the British argued that the bases were necessary to be able to strike into Russia in the event of a threat to Europe. Still, Egyptian nationalists (and many average Egyptians) wanted the British gone.
After the 1952 Free Officers revolution that brought Muhammad Naguib and Gamal Nasser into office, it was hoped that the talks would be accelerated, but the British ambassadors and the Egyptian junta did not like each other and the talks got bogged down into nasty name calling, obstructionism, and other attempts to sabotage or embarrass the other side. For example, Nasser used his regular radio addresses (which followed the very popular radio broadcasts of the singer Umm Khulthum) to attack the British as "colonial oppressors" and "occupationists", basically running up his Arab Nationalist street cred. For their part, the British played hard ball with Nasser as well; Nasser hoped to get British and American approval for an international loan to build the Aswan Dam, but the British pulled their endorsement and influenced the Americans to do the same, so the loan collapsed. The British also successfully persuaded the Eisenhower administration to stop military light arms shipments intended to update the Egyptian military (Naguib and Nasser's base of support) under the argument that these weapons would be used to attack British soldiers. Nasser then turned to Czechoslovakia for Soviet-made arms (which put him squarely in the "pro-Soviet" column in Washington's eyes, despite the fact that Israel did the exact same thing during its war of independence, but I digress)
Incensed, Nasser - who has successfully sidelined Naguib as leader of Egypt - hatched a bold plan to nationalize the Suez Canal. In his mind, having the Suez Canal's reliable and valuable income would either offer a good proof of credit for international loans or it would offer funds for a more direct self-funding of the Aswan Dam project without needing foreign money (the sources are mixed on this and Nasser didn't shed any real light on the subject later in life). The great irony of the nationalization is that Egyptians were already working the canal and maintaining it, only lightly supervised by the British, so it wasn't like the British were really needed anyway. So on the 26th of July, 1956, Nasser (now President) made a speech in which he mentioned the name of the Canal's main engineer, Ferdinand de Lesseps, which was the code word for Egyptian military to simultaneously take over all the lock and control stations from the British. Nasser then offered the British company who owned the canal the "fair market value" of the shares on the company, in accordance with international law. The financial screams from London (and to a much lesser degree, Paris) reverberated in the governments of London and Paris.
The British and French loudly proclaimed that the Egyptians were too incompetent to adequately run the canal, leading to a potential world-crashing slow down and traffic snafu. But that never materialized, largely because the Egyptians were already experienced at running the canal. The French and British tried to force a crisis by refusing to authorize payments to the new Egyptian government, expecting the Egyptians to refuse passage for non-payment, but the Egyptians didn't take the bait, instead just noting the passage of the ships and sending periodic bills. So, after several months, the crisis the British and French predicted never manifested.
Knowing they legally did not have a leg to stand on, envoys from Great Britain and France met clandestinely with envoys from Israel to hatch a plan to fabricate a crisis in Egypt which would allow the British and French to intervene in order to "ensure international stability." In return for its help, the Israelis would be allowed to keep parts of the Sinai peninsula (as well as nuclear technology). The "War" between Israel and Egypt was a complete farce with British and French bombers striking as far away as downtown Cairo while completely ignoring the Israeli troops. Paratroopers from both countries landed along the canal and took over the operations in order to "separate" the two belligerent sides. Egyptian troops could not come within miles of the canal, but the Israeli troops often interacted in a friendly manner with the Brits and French.
The US, which had been making a lot of political hay about the Soviet invasion of Poland to quell democratic protests earlier in the year, was incredibly embarrassed. The Soviets, happy to prove to the belligerence of the West while covering up invading a member of the Warsaw pact, was elated. The Soviets' bluster included threats to nuke Paris and London in retaliation but the Americans leverage against her two European allies was more potent and more dangerous. The Americans threatened to make all the Marshall Plan loans come due all at once and threatened to flood the market with British Pounds and French Francs, thus ruining their respective economies. Eventually, the French and British were forced to withdraw.
Nasser came out smelling like a rose, to boot. Nasser took tot he airwaves during the crisis, and after, bashing the British, French and (of course) the United States for its aggression. It was unbelievable that so obvious a ploy could have gone undetected by the American intelligence community, so it seemed that the US was at least complacent in policing its allies. This boosted Nasser's street cred as it seemed like he had stared down the French, British, and Americans while fighting the Israelis to a stand-still (facts being otherwise). In a triumphant speech, Nasser also announced (to the surprise of the Soviets) that the Soviet Union would be backing the Aswan Project, thus sealing Nasser as a kind of hero of the non-aligned movement and making him a household name in most Arab countries, giving him outsized influence in other nations' politics (such as Syria and Jordan).