Saving a switch input to choose mode of operation

Is there a reference for that? I'm new to this platform normally I'm in PLC world!