To ‘drive’ or ‘propel’ anything we need wheels. So how can steam be used to rotate wheels? We need a mechanism to productively use the pressure from the steam to make work. Engine!
Engines convert steam to work. A common mechanism of an engine consists of a cylinder with one end of it closed tightly. Inside it, a piston that can smoothly move up and down with little friction against the cylinder walls. If the steam can be directed into the cylinder the piston can be moved to produce motion.
A typical steam engine looks like this:
In this setup, when you let the pressurised steam into the cylinder from the left, it will move the piston (1) to the right. Similarly, if you let some steam on the other end, it will push it back to left. This to and fro motion is called reciprocating motion.
Look at the other parts to the right of the cylinder and piston now. Notice how the piston is connected by a rod (2) to a shaft (3) that looks like it is driving a huge wheel (4)?. This converts reciprocating motion of the piston to a rotary motion that can drive a wheel assembly. The flywheel acts as a reservoir of energy to keep the rotation smooth during the sudden change in pressure at the end of each stroke (to and fro movements).