Faulty brake light switch. The brake light switch is responsible for turning on the brake lights when the brake pedal is pressed. If the switch is faulty, the brake lights will not come on when the pedal is pressed. Test the switch by pressing the pedal and checking if the brake lights come on. If they don't, replace the switch.
Bad wiring. A short circuit or other wiring problem can also prevent the brake lights and taillights from working. Check the wiring for any loose connections or damage. Repair any damaged wiring and replace any shorted wires.
Faulty bulbs. If the bulbs in the brake lights or taillights are burned out, they will not light up. Check the bulbs and replace any that are burned out.