More comments about sand.
Just to add a bit more info about sand. Just any old beach sand won't do. Railway sand is clean, screened, sharp, hard sand. Above all it must be free-flowing in all types weather, temperature and humidity. To achieve this, it must be dried and kept dry. In the old days this was done in a Sandhouse. In winter the sandhouse was often the only reliably warm location in the yard and consequently often became the gathering place for employees, "between tasks", to shoot the breeze etc. but I digress. In a modern rail yard look for a tall, steel "barrel" high above the tracks with pipes angling down over the tracks to supply sand to the locomotives.
At the locomotive, the sand was not dribbled onto the rail but was jetted under the tread of the driving wheels with compressed air. Look for a pipe adjacent to the outside wheels of a locomotive very, very close to the top of rail and the wheel tread.
Combat is quite right that sand is a traction control device, but my understanding is that, in the context of the modern diesel locomotive, "Automotive Traction Control" refers to the ability of the locomotive's computer to detect the onset of wheel slip and adjust power to the wheels accordingly - all in microsecond time frame.