A countersteam brake is a brake on a steam locomotive that uses the engine (specifically the cylinders) to help brake the locomotive.
It uses the working principle of steam cylinders fitted with slide or piston valves such that, by changing the configuration of the valve gear, the motion of the valves is also altered such that they work in opposition to the movement of the pistons.
Because of the inertia of a steam locomotive in its initial direction of travel, changing the direction in which the steam cylinders have to work acts first to brake the movement of the connecting rod, which in turn slows the transmission of power to the drive of the locomotive until it stops.
The countersteam brake is often confused with the counterpressure brake, which works with air, not steam, and acts as a dynamic brake. Unlike the countersteam brake, the counterpressure brake is permitted to be used as an independent braking system in its own right.
Read more about Countersteam Brake: Operation