a few things you can start with, whichever is easier.
check the wires from the plug to the bulb socket for continuity or
remove the taillight lens and the base and you will find three bullet connectors attaching the wire from the plug to the base. confirm these are attached.
once you have confirmed all is in working order from the plug back, work the plug forward to the switch on the bars at the brake lever.