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's possible that the switch does power an outlet, but that the installer did not remove the fin that connects the top and bottom outlets. When the fin is removed, the top and bottom outlets are isolated from one another so that they can be independently powered. If the top and bottom outlets are wired with two wires of the same phase, you would not notice a problem with day to day use.
If you have a voltage tester, test to see if you have power to both the top and bottom terminals of the switch when the switch is in the off position. If you do, it's likely the installer just forgot to take a fin off one or more of the outlets.
There is probably a way to test for this without any tools, but I am stuck at the moment. Maybe someone else will have a suggestion.
If you have reason to believe that the installer forgot to remove one or more duplex receptacle fins, you have to get in the outlet boxes to fix the problem. Take off the covers to the outlets in the room. If you're lucky, there will be both red and black wires connected to the receptacle(s) with switched power. These are the receptacles where the fin should be removed.
If there is only black wires and no red wires, your next step is to find out how the installer connected the outlets to one another another. He could have used pigtails, using wire nuts to connect the "line" (wires coming into the outlet box) to the "load" (wires going to the next outlet). Or he could have daisy chained the outlets together, meaning both the the line and the load load is connected directly to the receptacle. If you find that the installer used pigtails, you can just look for the receptacles where both the top and bottom outlets are wired. This receptacle likely has your switched outlet. If they are daisy chained, you have your work cut out for you. I can't think of any other way than to start taking apart the outlets and testing the wires one by one.
If you find a receptacle that needs the fin removed, and there is a shared neutral, only take the hot fin off. If there is a neutral for both outlets, then take both fins off.
Safety note: Don't assume that all the wires in one box are of the same circuit. Test ALL the wires in the box before you go in there with your hands.
Best Answer
it sounds like the switch was installed in the neutral, that should be corrected.
https://electronics.stackexchange.com/questions/518257/what-is-switched-neutral