It varied considerably depending on air force, location, and date. Looking specifically at how close air support within the RAF was organised, until about 1942 the answer was "it wasn't". Despite joint land-air operations being absolutely fundamental to the RAF when it was formed in 1918, during the inter-war years independent operations were the overwhelming focus for a number of reasons (inter-service rivalry, government policy minimising the role of the Army). In particular the RAF concentrated on strategic bombing: it would cripple the ability of the enemy to make war at all, and if it really had to assist the Army it would do so by hitting enemy units well beyond the battlefield, striking transport and logistics. Close air support was viewed as "a gross misuse of air forces" that would incur disproportionate casualties for minimal results. In 1939 there was no joint system of command and communication for working with the Army, no aircraft in RAF service with the capability to attack battlefield targets with precision, "In short, the British Army and Royal Air Force had no airland capability for modern war." (Ian Gooderson, "Doctrine from the Crucible: The British Air-Land Experience in the Second World War", Air Power Review Vol. 9 No. 2).
The Battle of France demonstrated these shortcomings, the RAF and Armée de l'Air unable to secure any sort of air superiority over the battlefield or provide effective support to the Army. The RAF organisation was disjointed, an Advance Air Striking Force (AASF) was deployed to France for strategic bombing purposes, its light bombers not having sufficient range to reach Germany from the UK, an Air Component of the British Expeditionary Force represented the extent of army co-operation being primarily reconnaissance aircraft. Attempts to use the AASF against the German advance resulted in appalling losses in the face of German fighters and flak, most notably the May 14th raid on the Meuse River crossing at Sedan where 40 of 71 Battles and Blenheims were lost. That was an interdiction mission; the confused situation and breakdown in communications meant nothing approaching "close" air support was practical; army staff officers had to telephone London to communicate with the air force, who in turn had to reach the relevant units in France.
The debacle in France resulted in the creation of Army Co-operation Command within the RAF, an organisation at the same level as e.g. Fighter, Bomber and Coastal Commands (though starved of resources even compared with the latter, which viewed itself as something of a "Cinderella Service" compared to Fighter and Bomber Commands). In parallel the Desert Air Force in North Africa was grappling with the issues of working effectively alongside the army and the two units, Army Co-operation Command largely in theory and the Desert Air Force very much in practise, developed a system for providing direct air support to the Army that was used from 1943 when Army Co-operation Command was disbanded and replaced with the 2nd Tactical Air Force (TAF). Absolutely fundamental to any system was communication, the ability to get messages from units at the front to headquarters and then on to aircraft. To this effect Army headquarters, usually at the Corps or Division level, were accompanied by Air Support Signals Units (ASSUs) who used powerful dedicated radios to communicate with a joint Army Air Control Centre (AACC). In British parlance these were 'Tentacles', connecting the AACC with ground and air forces as required. The AACC had Army and Air Force staff who maintained maps of the current ground situation and information on aircraft readiness, and could therefore evaluate requests for support based on best knowledge of allied and enemy troop positions (a perennial problem with close air support is the danger of friendly fire) and availability of aircraft; when a target was accepted an Army Liaison Officer (ALO) briefed the squadrons tasked for the mission.
The system worked well for pre-planned air support, but was still flawed when impromptu air strikes were required most urgently, so was augmented in late 1944 by Forward Control Posts (FCPs), in which an RAF officer accompanied the Army units in vehicles with both 'Tentacle' radios and VHF sets to communicate directly with aircraft for in-flight briefings. Even further forward were Contact Cars, armoured scout cars that allowed an RAF Forward Air Controller (FAC) to visually direct air strikes; FACs were usually experienced pilots, allowing them to easily communicate with their colleagues using shared terminology. FACs most typically operated with "cab ranks", when 2nd TAF were able to deploy aircraft en masse. Flights of (usually) Typhoons would report to a certain area for direction from a FAC if there was an immediate target, proceeding to pre-planned strikes if they were not required and replaced by another flight on station. Though still not perfect, inter-service rivalries to continue to grumble on, air-land operations in the campaigns in France in 1944 were a massive improvement over those in 1940.
Further reading:
Allied Close Air Support 1943-1945, Ian Gooderson, PhD thesis
Army Co-operation Command and Tactical Air Power Development in Britain, 1940-1943, Matthew Powell, PhD thesis
The Right of the Line: The Role of the RAF in World War Two, John Terraine
"The Air/Land relationship – an historical perspective 1918-1991", Sebastian Cox, Air Power Review Vol. 11 No. 2