If it is only for turning a light on/off you should only need the black and red wires, assuming the white is common. The white could also be the common coming back from your light so wire nut it until you know. Your other two wires -red--black- should be 1. 120vac from your panel and 2. the wire to your light. Basicly just connect the red or the black to one terminal on the rocker switch and the other lead to the remaining terminal. Try turning the light on. If it works just put your switch and box back together and leave the white wire nutted. If it doesn't; hold the white wire copper lead to ground and try the switch. If the light works you will need to extend your white lead to any other group of white leads in a nearby junction box.
A white wire attached to a switch terminal cannot be simply treated as a neutral, Do not extend it to other white leads.
Disconnect all three wires from the old switch but remember what terminals they were connected to. Do not take apart anything else in the box.
If none of the switch terminals was stained dark colored or marked "common" then you will need to use a multimeter or ohmmeter to test the continuity between the switch terminals. With the switch in one position, two of the terminals will be shorted together. With the switch in the other position, a different pair of terminals will be shorted together. Mark the terminal that was always shorted one way or the other with a piece of tape or a dark ink marker. Also mark the wire that was connected to the dark terminal or the terminal you just marked.
Get a 3 way rocker switch. One terminal should be dark or labeled "common", if not then repeat the above continuity test.
Connect the marked wire to the dark or marked terminal of your rocker switch. Connect the other two wires to the other two terminals in any order.
The common terminal in this situation does not necessarily take the white wire but it might.