The EFCO buttons are in series with the coil of the fuel pump relay, hence when the button is pushed, it breaks the circuit, drops out the relay and shuts off the main fuel transfer pump. Also, the dropping out of the fuel pump relay activates the DV solenoid in the governor to go to shut down.
Older locomotives have a pull cord (instead of a EFCO button) located on both sides of the platform. This pull cord activated a mechanical valve which shut off the fuel supply to the diesel engine. For those of us in the business of preserving locomotives, this pull cord mechanism is a nuisance, as it gets rusty and binds up. In this case, its better to retrofit the locomotive with the now standard EFCO buttons.
Newer locomotives that have EFI diesel engines do not have a layshaft, so that's not an option. Other way to shut down an engine is to press the MU stop switch on the control stand, which not only shuts down the lead engine, but also the trailing units in consist via the MU trainline.