The most important thing to know is that your splices will happen within a junction box. The junction box provides a safe environment for your wire splices--protecting them against impact and containing sparks and fire, if anything should go wrong. While junction boxes may at first seem unwieldy and unnecessary, you'll find that they are easy to work with and will make your work safer. Plus, they are required by Electrical Code.
Most modern wiring (even up to 50 years old or so) will have the gauge and number printed on the side. In the example shown here, we will be joining 12/2 Romex wire to 12/2 Romex-style wire. The "12" refers to the gauge; the "3" refers to the number of wires, excluding ground, within the casing.
Before you proceed, turn off the power to both wires at the service panel (fuse box).