First rule of solder is clean. Clean the solder itself and the switch terminals with alcohol. Also, cut off the old wires and re-strip them so you are soldering fresh wire. Finally, never hold the wire in place while soldering. Strip enough back that you can stick it through the hole in the terminal of the new switch and fold it around or wrap it around the whole terminal so it is already held in place on its own. Once the terminal, wire and solder are all hot enough, surface tension will make it stick.