I soldered the extension used adhesive filled shrink tube to protect it from moisture and matched the existing 18 ga. The black sometimes red 12v and blue electric brakes wire may need to be reversed to suit the trailer.

How To Wire Lights On A Trailer Wiring Diagrams Amp Instructions
How to hook up 4 wire trailer lights. Seal up the split casing at the plug using electrical tape. The 4 way system is designed so the right brake light wire and right turn signal are green. Round 1 14 diameter metal connector allows 1 or 2 additional wiring and lighting functions such as back up lights auxiliary 12v power or electric brakes. For this truck all you need is a harness with the appropriate uscar connector on one end and a 4 flat connector to mate with your trailer on the other end. It doesnt get any simpler than this. This tow ready trailer wire harness has an uscar connection on one end and a 4 flat trailer connector on the other.
Buy a 4 pin wiring kit with wires at least twenty feet in length so its long enough for your trailer. If any lights do not work properly check your connections. Do not seal anything with silicone until the wiring is completed to avoid scraping away silicone which is messy. The most common wire thickness for a trailer is 16 gauge but i bought thicker wiring for added durability. It is referred to as such as the system needs a mere four wires for the trailer tail lights turn signals and brake lights to illuminate. Depending on the size of your trailer and the number of lights you might want to check on the internet for the recommended gauge for your specific trailer.
So the ground wire needs to be attached to the bed. Some vehicles have a 5 wire system and you need to purchase a trailer light converter that adapts the trailers 4 wire system to the vehicles wiring system. If you do not have a tilt trailer then connect the ground wire to the tongue. Though trailer lighting systems are available in an array of configurations the most popular is the 4 way system.