The switch was probably damaged by a short circuit caused by wiring your fixture incorrectly.
So - how do you fix?
Step 1: Turn off the fuse/breaker that was blown/tripped when you caused the short
Step 2: Remove the face plate for the broken switch
Step 3: Remove the screws that anchor the switch in the electrical box. Do not remove any wires.
Step 4: Study the switch and make careful note of where each wire connects. The old switch should have markings on it that indicate things like "hot", "neutral" and "ground". Take some sticky labels like mailing labels and write down each connection on a label and stick that label on the wire before you remove it from the switch.
Step 5: After you've labelled all the wires and removed the switch, take it to your local hardware store and buy a replacement.
Step 6: Come home and reconnect the wires exactly as they were before.
Step 7: Mount the switch in the box. Replace the face plate. Turn on the power in the fuse/breaker box.
It depends on which side of the switch is the line (power source from the box) and which side is the load (light and outlets).
If the two wire cable is the line and the three wire is the load, you may be able to use the red wire to carry uninterupted power to the outlets. The next question is whether the light or the outlets come next in the circuit, and whether that red wire shows up in their respective boxes.
If the outlet is next and the red wire is also capped in that box, you can use the red to power the outlets while still switching the light. Connect the incoming black line wire, the exiting red wire and add a black pigtail (a short length of wire). Then connect the other end of the pigtail to the switch where the incoming black wire was previousl.
At the outlet box, remove the incoming black wire going to the outlet and replace it with the incoming red wire. Attach the incoming black wire (that is now free) to the black wire going to the light. This may be attached to the far side of the outlet. If so, disconnect it from the outlet first.
If the light is next in line, this will only work if there are both black and red red wires going to the light fixture box. In that case, remove the outgoing black wire (going from the light to the distant outlets) and attach that outgoing black to the incoming red. Leave the incoming black on the light fixture.
If the red wire does not show up in the next connection box, you are out of luck unless you add additional wiring.
In sum, you need two hot wires leaving the switch box, a black one that is switched and a red one that is always hot. You are trying to keep the switched black connected to the light fixture and the unswitched red powering the outlet. (The colors are arbitrary, but since the red is not currently in use, we have designated it always hot).
Best Answer
You put the switch and the light fixture both between hot & neutral, effectively parallel to each other. That makes the light always on and the switch creates a short between hot & neutral - correctly tripping the breaker.
What you have is a switch loop. They are confusing at first but actually quite simple.
Light switches are normally wired in the "middle" of the hot wire between the power source and the light. The way you do that with a switch loop is as follows:
This uses the same wires you already have, just arranged slightly differently. Plus you need one more wire nut to connect the black power wire to the white switch wire.
In order to avoid future confusion, you should put colored electrical tape (not green or white) near both ends of that white switch loop wire to indicate that it is a hot wire.
As noted in a comment on the question, you may want to preemptively replace the switch as it may have been damaged by arcing from shorting. If you do that (or if you replace it sometime later for any other reason), keep in mind that a traditional switch loop does not have neutral. That rules out many, but not all, options for timers, lighted switches, dimmers, smart switches, etc. If you put in anything other than a simple switch, make sure that it does not require neutral.