Locomotives at the time relied on steam power to move. Heat from burning coal was used to turn water into steam. This steam was then moved to the cylinders to move the wheels. It took some time to build up enough steam to start moving, but when they did, the people running the train would blow the whistle to show they were ready to leave.
To move the locomotive required a lot of steam, which needed heat. Coal was shoveled into the firebox and burned, making smoke and heat. The smoke was released through the chimney while the heat boiled the water and made steam. The steam was then directed to the cylinders through the steam pipes.
As steam enters the cylinder, the pistons are pushed by the pressure, moving the wheels. Steam then goes into the cylinder the opposite way, which pushes the piston and finishes the wheel’s rotation. This pattern of pushing the piston is what makes the engine’s “chuff chuff” sound. The steam then exits out the chimney along with the smoke from the coal.
While there were other ways of building the cylinders and attaching pistons, most locomotives worked similarly: the flow of steam was regularly changed to rotate the wheel.