Ron is right.., it's not difficult however, the way yours is butchered up by the PO ...., you may be better served
if you go to an electrical shop or U-haul (they do hitch/wiring).
Also, it's best to have the trailer there as well. It's "MALE" plug-in end needs to match the "FEMALE" end
on your truck. (assuming the trailer still has one on it)
In some cases, there's adaptors.
Point being.., the time, expense hooking up what's there may be a waste if they don't match.
The female receiver-plug on the truck looks OK, just needs cleaning up. Along those lines, wash-n-wipe
down all those wires so whoever does the work will have a clean start.
Likely need wire crimpers, strippers, wire end connectors, & a volt meter. In some cases, a soldering iron &
shrink tubing.
A shop may let you watch so you'll know how in the future.
Good luck, have fun with it,
B