First figure out what is connected to the switch - AC, 5V DC, 48V DC? Switches have voltage & current ratings. Replacing it with something higher is typically okay assuming you're not dealing with micro-voltages & currents where switch resistance is critical.
Next, you need to determine the number of poles (the number of conductors which are switched). So a double-pole switch can control two conduction paths (e.g. a stereo A-B switch, which has left and right conduction paths).
Finally, you need to know what the switch does with those conduction paths. The basic ones are (but there are many others):
momentary contact is like a button, it is only on as long as you hold it
single throw is like a normal light switch, on - off
double throw is like an A-B switch, on - on
Then take that info and start looking for an equivalent toggle switch which meets your needs (and is panel mount and the size you want).