You find where it's broken first. That determines how it's repaired. You might install a new terminal, splice a cut wire, or if it's severely corroded, run a new wire. If the wire is corroded off a socket, replacing the entire socket is usually easiest. Some vehicles use printed circuits on the lamp housings and those can develop a hairline crack. Some can be repaired. Some have to be replaced.