brake light problem

You want good clean bulb sockets and verify each housing has a ground.
You might be able to just have the brakes on and wiggle the bulbs a little bit and if it's a ground problem they will sometimes make contact again and work right.