A large diesel engine spins an electric generator. Electricity goes from the generator to the electric motors under engine. The motors turn the wheels. Steam pushes pistons back and forth. The piston rods turn the wheels.
Electric locomotives Get electricity from overhead wires or a third rail near the ground.
The electricity may have to be converted to a type that works the motors. The motors under the train turn the wheels. In a real emergency, you may be able to tell an engineer to stop the train by waving a light back and forth across the track. You do not have to stand in the middle of the tracks. Stand next to the track at least 3 feet away from the rail.