Knowing how to wire a switch is a matter of looking at the product datasheet. It will tell you which terminals are common, which are normally open, which are normally closed, and in what position common terminals are connected to others.
When you come upon or salvage a switch with unknown contacts, you have to do some continuity and resistance checking (you have a multimeter, right?). Measure the resistance from one contact to another. Operate the switch and make notes about whether the resistance changes. Or use continuity mode and listen for the beep.
A lighted switch usually has separate contacts for its internal LED or bulb. For those you will need to apply whatever voltage the light is meant to operate at. If you don't know, start low and increase it gradually. In the case of an LED it will have polarity, so for example you might try 3 volts from terminal X to Y, then from terminal Y to X. Then try 5 volts from X to Y, and from Y to X. It can be tedious.
From the link in your comments, I can make out "R13-244" on one of the diagrams. Searching for that, it appears to be a SCI Parts switch. However, I was not able to find the specific 12V LED version.
Other answers and comments address other points, such as:
- whether the switch is actually SPST with separate terminals for the light
- why you don't need to switch both sides of the solenoid
- including a flyback diode when driving a solenoid
- why a datasheet is important
So I'll leave it at that.