If you're going to turn wrenches you will eventually encounter a bolt, nut, or threaded hole that has stripped out threads. You may be able to install a longer screw to engage the deeper undamaged threads, but this only works on applications where there's little need for dependability. You might also be able to replace both the nut and bolt. If you can, this is usually the best way to deal with damaged parts. In some cases, however, you have make a repair by fixing the damaged part.
There are two basic methods of repairing a threaded part. The first method is to cut new threads. If your part has threads on the outside (such as a bolt), then threads are cut with a die. If your part has threads on the inside (such as a nut), the threads are cut with a tap.
A tap is a little like a bolt, and a die is a little like a nut, except with both tools the threads have edges to cut metal. Both taps and dies come in many diameter sizes. There are also thread types such as standard fine and coarse, and metric. If your plan is to simply clean up minor damage, you need to assure you use the correct size and type. You'll find a thread gage helpful in determining what you need. Rethreading tools may be more appropriate if the damage is minor. These are very similar in appearance to a cutting tap or die, but are meant for simply cleaning up damaged threads.
Assuming you've decided the threads are beyond simple repair, in most cases you will drill out the hole to remove the damaged material and use a tap to install new threads. This will mean you'll also need a new bolt to match the oversized hole. There are three general types of taps: the tapered tap (most common); the bottoming tap (for cutting threads into dead end holes, but not used for starting the threads because they have no taper); and the pipe tap (for pipe threads). In some cases you might need to make a new part and use a die to put new threads on it. Think through the project carefully, however, if you're considering cutting new threads on the male part as this could cause potential problems with undersizing and perhaps make it weaker than needed for the design.
To use a tap, as stated before, drill out the hole to clean out the damaged material. The size hole will depend upon the design of the material and the available bolts that will match the design. The size hole is also determined by the recommendations of the tap manufacturer. If the hole is drilled too large, the threads will be shallow and strip out easily. If the hole is drilled too small, the tap can easily break because it's trying to cut out too much material.
Although it is possible to use a regular adjustable wrench to turn the tap, it's highly recommended to use a tap wrench. Tap wrenches are a T type handle that allow you to turn the tap from each side instead of from one side as you would with an adjustable wrench. When turning from both sides, apply a smooth symmetrical torque to minimize the chance of breading the tap in the hole. Removal of a broken tap is a task well worth avoiding, so the cost of a tap wrench is something you should strongly consider.
Once the hole is drilled and tap selected, lubricate both the hole and the tap with cutting oil. As you turn the tap, chips of metal will form. Rotate the tap 1/4 to 1/2 turn, then back it off 1/2 to 3/4 turn to break off the chips. Continue until this back and forth turning until the tap turns freely through the entire hole, or until it bottoms out in a blind hole. If a blind hole, once the tool bottoms out use a bottom tap of the same size to cut the threads to the bottom of the hole.
Using a die to cut threads on the outside of metal is much easier. Again, make sure the outside diameter of the material matches the die manufacturer's recommendations so you get threads that are deep enough but not so deep as to make cutting the threads difficult. Use cutting oil and a die handle to make the cut. Although the risk of breaking the die is less when using an adjustable wrench than it is on a tap, it's still recommended to use a proper die wrench. The smooth symmetrical torque provided by a die wrench makes getting straight threads much easier. Begin by using a file or grinder to put a small chamfer on the end of the material. this makes starting the die much easier. As with a tap, turn the die back and forth to break up the chips.
The second method of repairing damaged threads, and the method used primarily when repairing inside threads, is to drill out the hole and install an insert. One common type is called a Helicoil. A Helicoil is a spiral of hardened metal sort of like a set of threads with neither hole nor bolt. To use a Helicoil, drill out a hole, tap it to the proper size for the Helicoil, apply the Helicoil to the insertion tool, then simply screw it into the hole. They are quite simple to use, and in many cases the Helicoil is a harder metal than the original threads so it's unlikely to strip out as easily.