Unfortunately the Switchmaster 400 is from an era, before there was very much standardisation and each manufacturer had their own wiring configuration. So unless you can source another Switchmaster 400 on an auction website for example, some minor rewiring will be required to replace it with a new programmer.
When sourcing a replacement, you will also need to consider the type of heating system that you have. Some systems are 'fully pumped' and others have just the central heating pumped but the hot water cylinder is heated by natural circulation, this second type is referred to as 'gravity circulation' Gravity systems generally haven't been installed since the 1970's so there aren't that many still around.
But it is important that you know which you have. With a fully pumped system, the heating and hot water can be controlled totally independently, but with a gravity system, it is not possible to have the central heating 'on' without the hot water also being 'on' at the same time. If you do have a 'gravity' hot water system, because they are now so old, not all new programmers are compatible with them, so you would have to make sure any replacement was.
Once you have obtained a replacement, the wires are connected to the Switchmaster terminals as below:
It would be a matter of moving the existing wires from the Switchmaster terminals, to the terminals of the new programmer that have the same function. Don't worry if any of the terminals don't have wires in, that's normal.
As an example, a possible replacement would be a Danfoss CP715 which uses the same connections as the majority of programmers do these days. It can be set to operate gravity systems and is wired as below:
In which case the wires would be transferred from the SM400 to the Danfoss as follows:
SM400 N = Danfoss N
SM400 L = Danfoss L
SM400 1 = Danfoss 4 (Central Heating on)
SM400 2 = This is a spare terminal and if currently used, the wires in it should be connected together in a separate isolated terminal.
SM400 3 = Danfoss 3 (Hot Water on)
SM400 4 = Danfoss 2 (Central Heating off - this is probably not used though)