The expansion of steam pushes the pistons that connect to the driving wheels that operate the locomotive. Coal or oil are the fuels used for heating the water (coal is shown in the diagram). Coal is carried in the tender of the locomotive and is hand-shoveled by the fireman into the firebox.