An SPST switch is a simple on/off switch. SPST stands for Single Pole Single Throw and it is the most basic of switches controlling a single piece of equipment from a single power supply.
In a model railway scenario, this switch is used to operate anything on your layout that you want to switch permanently on or off. A few examples of such items are building lights, street lights, rotating windmills and wind turbines, etc.
An SPST switch has two terminals on the back of it. One is to connect to your power supply (usually a wire fed from the auxiliary port on your controller) the other is for a wire to run from the switch to whatever it is that you want to power. From there a separate wire will run directly back to the controller (power source) therefore completing the circuit.
It is important to note that although the switch and its wiring are simple, the electric that runs through it is not. There are different types of electric (DC or AC) and also different voltage amounts, so the power that runs through the switch is a more complex subject and because of this, if you are new to electrics you should always take advice from experienced modellers or your local model shop to avoid accidental damage to your components.