In its most basic form, a manual transmission consists of a set of gears along a pair of shafts, the input shafts and output shafts. The gears on one shaft engage with those on the other shaft. The resulting ratio between the gear selected on the input shaft and the gear engaged on the output shaft determines the overall gear ratio for that "gear."
The driver selects gears in a manual transmission by moving a shift lever, which engages a linkage that controls the movement of the gears along the input shaft. Moving the lever forward or rearward chooses between the two gears available on a given linkage; cars with four gears, or speeds, use two linkages; cars with five or six speeds use three linkages. The driver changes between linkages by moving the shift lever left and right.
To engage a gear in a manual transmission, the driver pushes in the clutch pedal, disconnecting the engine from the input shaft of the transmission. This frees the gears on the input shaft to move, as when the engine is sending torque through the input shaft, the gears on it are engaged. Once the clutch has disconnected the power from the engine to the transmission, the user selects the appropriate gear (i.e. first, third, reverse) and releases the clutch, re-engaging engine power to the input shaft and propelling the car with the selected gear ratio.
In an automatic transmission, the same essential process is going on within the transmission itself, but it's all done behind the scenes. One of the primary differences between an automatic transmission and a manual transmission is that automatics don't use clutches (typically, anyway). Instead, the automatic transmission relies on a torque converter to de-couple the engine and the gear set.