All steam engines operate on a similar basis, regulated input steam from a boiler passes through a valve and enters a cylinder, pushing the piston to the other end.
The valve moves, and directs the steam to the other end of the cylinder, moving the piston back to the opposite side, pushing the now exhaust steam on the other side out of the cylinder. The momentum created by the flywheel assists in the operation, and the process repeats, continuing to drive the flywheel. Pictured is a cylinder from a steam locomotive.
Boilers are constructed in many ways, but in power generation, water tube steam generators are the most common. Fuel is injected with air in the side, it combusts, and the ash falls to a pit, and heat rises through tube arrays. Exhaust is reused to preheat intake air.
Another fuel type for similar boilers is solid fuel, or coal. The coal is stored in a hopper, and when needed, either an auger or belt moves it out the bottom. Boilers like this can be seen in heating applications, and sometimes for backup energy. They usually have a moving chain grate, and the fuel slowly makes its way through the firebox.
The chain grate moves slowly enough for the fuel to burn thoroughly, by the time it reaches the end, where the remains and ashes are removed from the bottom of the firebox. These are known as automatic stokers.
Scotch marine boilers, commonly seen in these applications, are laid out horizontally, like a locomotive boiler. In the days of steam ships, this was the type of boiler most commonly used.
Modern scotch marine boilers are usually gas fired, with one or multiple burners, sending a massive flame through the firebox. They can also have automatic stokers.
Scotch marine boilers are a three pass fire tube flue system. The flue gas travels from the firebox towards the front of the boiler. It rises and returns through the boiler a second time. It reverses again in a smokebox just over the firebox door, and passes to the front and out a separate exhausting smokebox. Sometimes they are built with more passes, and the more passes in a boiler, the more heat extraction rate, or efficiency. Basically, this means less heat goes out the stack.