Tools You'll Need
Find the offending section of cableThe first thing we need to do is work out where on the cable the break has occurred. First, plug the headphones into an audio source and put on some music. Put the headphones on, bend the cable 90 degrees across the top of your thumb and run it along the length of the cable starting at the jack-plug end. The majority of breaks occur here as it is the point of highest stress (should this be the case for you, see the "Replacing the Jack Plug" section below). When you reach the location of the break, the sound should crackle and drop in and out. You can confirm this by then curling and twisting the cable at that point. When you're happy that you've found the right site of the break, mark it with a piece of electrical tape.
Fixing a Mid-cable Break
I can't stress this enough: slide the shrink tube on NOW. There is nothing more frustrating than completing a professional soldering job, only to realize that you've left the shrink tube lying on the workbench.
Remove about a half-inch of the outer shielding using your wire strippers, or by carefully running a knife sharp circumferentially around the cable. You'll notice that I'm using a side-by-side cable which means that both wires are shielded independently, each with an exposed earth. If you're using a single cable that you would expect to see on a pair of Apple headphones, you will have exposed two lengths of shielded wire and a single unshielded earth.
Splicing the CablesThere are two common types of wire splices, Pigtail and In-line. To create a Pigtail splice, hold the two exposed sections of wire that you wish to join parallel to each other, then twist them together to create a join. While quicker and easier than In-line splicing, this leaves you with an angled join which does not flow naturally with the cable.
In-line splices are achieved by holding the wires so that they overlap end-to-end, then twisting the wires in opposite directions to create a strong join which fits with the natural direction of the cable. More fiddly to complete, but worth the extra effort.
You'll notice that I've opted for the pigtail splice in the example below, this to keep each of the joins separated for clarity in the guide photos. Splice red to red, white to white and earth to earth. If it makes things easier, you can combine all of the earth wires - they don't need to be kept separate from each other, just the red and white.
Soldering the Connections
Once you've completed all of the joins and let them cool, wrap the two pairs of joins in electrical tape to ensure the red/white are kept separate from the earth wire.
Slide your shrink tube over the two taped sections and apply heat. The tube should shrink down to a quarter of it's original size, fitting snugly to protect and strengthen your newly repaired section of cable.
That's it, you're done! Your headphones should now be ready to use. Test them again with your audio source to be sure.
Replacing the Jack PlugIf the cable break is found at the plug, it's time to get a little cathartic. Cut off the offending plug along with roughly an inch of cable, cast them aside with all of your pent-up frustration for the trouble they've caused. For this repair you'll need the tools listed above, plus some fine sandpaper and a metal replacement jack plug with a spring. These too can be found at an electronics store.
Our goal here is to replicate the connections in the old plug, on the replacement. Most plugs are plastic molded these days making it difficult to see where each connection went. By rule of thumb, the white wire should connect the left speaker to the tip probe; the red wire, the right speaker to the ring probe; and the earth to the sleeve probe. If you're unsure, confirm which probe connects to the tip with a multimeter.
Slide the plug cover, spring, and shrink tube onto the wire. As above, do this now to avoid having to re-do your work later. Now we are going to "tin" the wires that will connect to the probes on the replacement jack. To do this, strip the wires and apply a thin layer of solder to the exposed wires using the same soldering method as with the mid-cable break above.
Using sandpaper, roughen the surfaces of all of the probes to help the solder stick to the metal. Solder the white wire to the tip probe on the replacement jack. To cleanly achieve this, bend the wire 90 degrees in the middle and insert through the hole in the probe. Now bend the wire back toward the cable making a hook, of sorts. Solder in place.
Now, solder the earth to the sleeve probe from the underside.
Repeat the previous two steps, connecting the red wire to the ring probe, and the second earth to the sleeve probe. Slide the shrink tube up over the plug probes and apply heat. Once cooled, screw on the jack cover and you're finished!
Go ahead! Go for a walk and test them out. After all, you should always be testing.