Your car's brake light switch is effectively a relay that tells the brake lights to come on when you press down on the brake pedal. If your brake lights do not work, and you have tested the bulbs and know that they are not broken or dead, usually it is the brake light switch that is at fault. Fortunately, changing a brake light switch is an easy and inexpensive job, so you can save time and money by changing the switch yourself rather than taking your car to a shop.
Open the driver door of the car and kneel down inside so that you can see and reach the underside of the dash, where the pedals connect.
Remove the two or four Phillips-head screws that are behind the brake pedal and that hold the electrical cover in place. The number of screws will depend on your model and make of car. If they are not Phillips-head screws, they may be 10mm bolts, but this is not common.
Remove the cover. Inside you will see the brake light switch, which is usually held in place by two bolts. Remove these bolts with a socket wrench, and then you may remove the brake light switch and disconnect the electrical connector that supplies it with power.
Plug the electrical connector into the new brake light switch. Put the brake light switch in place, and replace the two holding bolts that were removed previously.
Replace the electrical cover and the screws that hold it in place. Turn the car on and press the pedal. If the lights come on, then your problem is solved. If not, then the brake light switch was not the problem, and you should have the car diagnosed by a certified mechanic.