The breakaway switch is very inexpensive, best to replace the entire switch, its only two bolts and two wires. The new switch comes with a new cable. I bought one from Vintage Trailer Supply.
There's lots of opinions on the correct way to route and connect the breakaway wire. Here's mine:
The breakaway switch is intended to activate the trailer brakes if the trailer separates from the tow vehicle. If the trailer is still attached in any way to the truck (ie. safety chains) you can still control trailer brakes with the brake controller. If the Trailer totally separates from the Truck you want those brakes on!
So you want enough slack in the cable that the pin doesn't pull out in a turn, but not so much that it can drag on the ground or get tangled in the hitch, safety chains etc. You also want the cable attached to part of the tow vehicle that is not part of the hitch.
I route my cable through the pad lock on the trailer coupler and attach it to an eye bolt I installed to replace one of the licence plate bolts (read that on the internet somewhere
) This way if the entire hitch falls off the truck, or the hitch head breaks and the safety chains fail, the pin will be pulled. My cable is long so I put a 6" loop in the cable and secured it with a small plastic zip tie. This way in a tight turn if the cable binds it can pull the loop out and not pull the pin.