a steam locomotive is a steam powered railway locomotive. it was used a lot between about 1830 and 1970. afterwards, diesel and electric locomotives were used more often. the first steam locomotive was made by richard trevithick for a railway used for moving iron at an ironworks in wales. a steam locomotive works by burning a fuel like coal in a special space called a firebox. this produces hot gases that rise and go through tubes in a boiler - a large space with water in it. this heats the water, producing steam. the steam is then taken through another tube to a cylinder. the steam then pushes the piston which in turn pushes a metal rod that is connected to the wheels, making the locomotive move. the steam then rises out through the chimney.