The vast majority of automotive petrol engines operate on what's referred to as the 'four-stroke cycle'.
In a conventional single-cylinder petrol engine the hot, expanding gas -- created by burning fuel and the oxygen in atmospheric air together -- is used to drive the engine's piston downwards in the cylinder. The piston is connected to the engine's crankshaft which, like the crankset on a bicycle, converts the up-and-down motion of the piston to rotational motion.
These components are all part of the 'reciprocating assembly' and sit within the engine's cylinder block. Atop the block you'll find the cylinder head, which seals the cylinder shut. This creates a controlled space, between the head and the top of the piston, called the 'combustion chamber' - where fuel and air can be burned effectively.
Typically, the cylinder head will also contain intake and exhaust ports that are sealed by valves. The intake valve - or valves, depending on configuration - controls the flow of fresh mixture into the cylinder. The exhaust valve, on the other hand, regulates the flow of waste gases out of the cylinder.
The first stroke in the four-stroke cycle, in which the piston starts at the top of the cylinder, is the 'intake stroke'. The intake valve opens and the piston travels down inside the cylinder, creating a depression which causes fresh air and fuel to be drawn in.
As the piston reaches the bottom of the cylinder, the intake valve closes and energy stored in the engine's flywheel continues to turn the crankshaft - which starts driving the piston back up the cylinder. This is the 'compression' stroke, during which the piston squashes the trapped fuel-air mixture to a fraction of its original volume.
When the piston reaches the top of the cylinder, a spark plug mounted in the head generates a spark and ignites the mixture. This is the start of the 'power' stroke. The valves are closed so the burning, expanding gases have nowhere to go - so they force the piston down the cylinder, driving the crankshaft around.
As the piston hits the bottom of its stroke, the mixture has finished burning and all that is left in the cylinder are the by-products of combustion. These need to be ejected, which is what happens during the 'exhaust' stroke. The exhaust valve opens and, as the piston travels back up the cylinder, it pushes the waste gases out.
As the piston approaches the top, the exhaust valve closes, the intake valve starts to open and the whole cycle - which takes two complete revolutions of the crankshaft - starts afresh. Or, in short, 'suck, squeeze, bang, blow'.