Basic procedue is like this:
Solder the power cap to the battery wires from the ESC and solder the diode to the motor wires from the ESC. If you're using generic caps, It should have a silver line on the side that indicates the polarity. That line is negative, while the silver line on the diode is positve. Make sure to check the polarity first before soldering any connections.
I made a simple diagram for you to follow.
Hope this helps.