Keeping it simple there are four different parts in a steam engine:
Obvisously that is a very simple description, more detail about a steam railway engine can be read below.
It's easiest to see how everything works in the diagram of a steam locomotive, below. Inside the locomotive cab, you load coal into the firebox (1), which is quite literally a metal box containing a roaring coal fire. The fire heats up the boiler—the "kettle" inside the locomotive.
The boiler (2) in a steam locomotive doesn't look much like a kettle you'd use to make a cup of tea, but it works the same way, producing steam under high pressure. The boiler is a big tank of water with dozens of thin metal tubes running through it (for simplicity, we show only one here, colored orange). The tubes run from the firebox to the chimney, carrying the heat and the smoke of the fire with them (shown as white dots inside the tube). This arrangement of boiler tubes, as they are called, means the engine's fire can heat the water in the boiler tank much faster, so it produces steam more quickly and efficiently. The water that makes the steam either comes from tanks mounted on the side of the locomotive or from a separate wagon called a tender, pulled behind the locomotive. (The tender also carries the locomotive's supply of coal.) You can see a photo of a tender showing its water tank further down this page.
The steam generated in the boiler flows down into a cylinder (3) just ahead of the wheels, pushing the piston (4), back and forth. A mechanical gate in the cylinder, known as an inlet valve (shown in orange) lets the steam in.
The piston is connected to one or more of the locomotive's wheels through a crank and connecting rod (5).
As the piston pushes, the crank and connecting rod turn the locomotive's wheels and power the train along (6). When the piston has reached the end of the cylinder, it can push no further. The train's momentum (tendency to keep moving) carries the crank onwards, pushing the piston back into the cylinder the way it came. The steam inlet valve closes.
An outlet valve opens and the piston pushes the steam back through the cylinder and out up the locomotive's chimney (7). The intermittent chuff-chuff noise that a steam engine makes, and its intermittent puffs of smoke, happen when the piston moves back and forth in the cylinder.
There's a cylinder either each side of the locomotive, or between the frames, and the two cylinders fire slightly out of step with one another to ensure there's always some power pushing the engine along.
Some steam locomotives such as our own 35011 General Steam Navigation have three cylinders
(two outside and one inside), while some even have four cylinders two outside and two inside).