what is sand box

Do train engines get filled with mud? Then what is the use of this sand box?

If the engine is not installed in the train, then all the iron boxes attached…