This is how the train wheel works to keep the train on track

This video shows the guidance by railway tracks. The model explains the interaction between railway wheels and railway tracks. It is shown how design features such as a conical tread, a rigid axle and a flange are necessary to impede jamming and override. Together they prevent the wheel, and consequently the train, from derailing.
Train wheel