You need to use a soldering iron that's low wattage (around 25 watts). Anything with a wattage higher than this could cause damage to the switch and/or melt the plastic the switch is mounted on. The proper soldering iron can be purchased sometimes as a kit which includes the rosin core solder. Craft stores like Hobby Lobby, Michael's, Jo-Ann and big box like Lowe's, Home Depot or a good hardware store are good sources for these items.
The posts on the switch should be a dead giveaway as to which posts the wires were originally were soldered to as there should be solder residue and possibly some of the wire strands that broke off from the wire. Unfortunately, the picture is a bit out of focus so I'm not 100% sure. If you have an ohmmeter, you can test these terminals to be 100% certain these are the two to reattach the wires to on the switch.
You need posts that are free of any solder build-up and debris before you re-solder the wires.
Rather than try to explain the procedure for soldering, a visit to YouTube for this on a video on this would be beneficial.
It doesn't matter which wire is connected to each terminal.
I keep a little container of water and a paper towel nearby for cleaning the tip of the soldering iron and wiping off the solder buildup.
I hope I provided enough information to get you started.
BTW- I have a solar cat that we put outside at our campsite too.