After the fall of France, the British Commonwealth forces were engaged in North Africa by the Italians and later Germans, while the United Kingdom itself was under attack by the Luftwaffe and made preparations to repel a potential German invasion. Although the British knew they could not invade mainland Europe with a hope of success at that time, they were emboldened by the victory in the Battle of Britain (October 1940) and success in North Africa through Operation Compass (December 1940 into early 1941). Striking at Europe directly was out of the question, but attacking the periphery was possible.
The future direction in Europe was unclear. The British looked towards America and the Balkans for potential allies. Bringing Yugoslavia and Greece into the war on the Allied side would preempt the need to make amphibious invasions, while the United States was obviously looked to because of its vast industry and bountiful resources. The Italians attacked Greece, but got bogged down quite early on in the campaign. With the German entry into the war (and simultaneous attack on Yugoslavia in 1941), the Greeks and Yugoslavs fell in a matter of weeks and the British were once again faced with the prospect of needing to land on the continent by force.
The entry of the Soviet Union into the war in 1941 was a cause for both celebration and concern from a British perspective. On the one hand, this was the strongest ally against Hitler that the British could hope for, and the conflict between the Soviets and Germans meant that the previous Soviet-Nazi cooperation was over. On the other hand, the Soviet Union may be defeated before the British could finish marshaling their forces. If the Soviet Union fell, that would make it incredibly difficult or impossible for the British, even with American support, to force a landing and wage a viable campaign against the Germans. The defeat of the USSR would provide the land, resources and slave-labour necessary to compete the United States in production terms and escape blockade by the British.
In late 1941, things changed. The Americans entered the war and the Soviets halted the German advance at Moscow. With the situation seeming to stabilize and the added military potential of the United States, an invasion of the continent was back on the table as a possibility, albeit a long term one. The immediate priorities of the British (and now the Americans) remained the same - secure Europe's peripheral regions (i.e. North Africa), deny resources to the Fascist powers of Europe through blockade, and build up forces - naval, air and land - in preparation for future action.
With long term possibilities in mind, the first concrete preparations for an invasion took the form of the Dieppe raid (Mid 1942). A force of Canadian, British and American troops attempted to land, seize a port and hold it for a sustained period of time to both demonstrate the viability of such actions and to gather intelligence. The raid was a failure, but valuable lessons were learned.
In late 1942, the Allies continued to pursue their objective of securing the European periphery. Operation Torch was the first major action of the US Army, and was a major success. Within six months, North Africa was securely in Allied hands, and preparations for future operations were already well underway.
In Early 1943, the British and American leadership had met in Casablanca to discuss the direction of the war after North Africa was wrapped up. The two options were an invasion of France, or an invasion of Italy. The latter won the debate, and as such, a mere 2 months after the conclusion of the North African campaign (Mid 1943), Operation Husky was initiated, an invasion of Sicily. This was followed quickly after (September 1943) with the invasion of the "toe" of the Italian boot.
In terms of preparation for these invasions, the Allies needed to gather sufficient landing craft (taking priority over the Pacific theatre in most cases), marshal ground forces and secure naval + air superiority. Intelligence gathering was a combination of Signals intelligence (e.g. intercepted transmissions), aerial reconnaissance and human intelligence from local opposition or resistance groups. For Overlord, the preparations were far more extensive, including the construction of artificial harbors (Mulberries), extensive bombing campaigns aimed at paralyzing German logistics in the region surrounding the targeted areas, the construction of a variety of bizarre vehicles (Hobart's Funnies) for the invasion, and a series of disinformation campaigns aimed at obfuscating the true target and date of the invasion. You may also be interested in one specific disinformation campaign, Operation Mincemeat, which was designed to obscure the imminent invasion of Sicily in 1943. It's quite a read!