Hi,
Check if there is 12V DC at the RH brake bulb connector terminal when the brake pedal is depressed.
If there is voltage then check if there is a good earth connection at the bulb connector terminal by connecting an Ohmmeter between an earth point (any bright, shiny metal point on the body of vehicle) and the other connector terminal on the bulb i.e not the same terminal where the power was detected.
Also check that the connectors inside the unit where the bulb is inserted are not corroded preventing a good electrical connection.
If there is no voltage then here’s the 98 Legacy Wiring Diagram (MSA5TCD98L) Online that may help. (couldn’t find one for a ‘99 model so hopefully they’re the same). Go to p.151 (or 51of 57 .pdf numbering) to get to the start of the rear end wiring section so that you can follow the wires back from the RH taillight assembly through the different harness connectors.
If all this seems too daunting, contact a reputable, professional auto electrician and ask for a quote
crwdns2934105:0crwdne2934105:0
crwdns2934113:0crwdne2934113:0
crwdns2915270:0crwdne2915270:0
crwdns2889612:0crwdne2889612:0
2