I bought some led lights and ran into the same issue.
Heres what you have to do if you look on the back of the Tailight itself there will be a connection which is the same as the one on the two seperate black boxes you have . Unpug it then plug the black box's connections into it. it will make it where the blk box plugs into the taillight and then the plugs that actually go into your lights plug into the the left open connector on the black boxes cables.
Next step is installing to your truck lights. The stp tail lamp goes into the middle socket or the brown factory socket or at least mines was brown then the bearing plug goes in the top grey light socket this will be the longest one.
Make sure you plug them in so the labels are facing up, if you plug them in upside down then you will blow the fuse under the hood its a 10A fuse just in case for some reason your tailights dont work after attempting to install .
he black box should have 3m sticky tape I stuck mine on the bottom of the talight housing so you could not see it. then of course you have to put the reverse light in the bottom home on the housing this will be the shortest factory socket and u will reuse the bulb unless you uograde it to led or etc.
Now on my esv I know there was one small light bulb that the taillight hosuing did not have a place for I just put it in the quarter panel with the other wires and left the bulb in. At night it looks cool because its glowing underneath your led light. If oyu have any other questions you can let me know and I'll gove you my # and walk you thru it.