To replace a power cord, disconnect it, cut the damaged portion off, and strip a 1-inch section of the plastic tubing to expose the wires. Next, twist each individual wire to its corresponding color match on the new cord, and then cover each of the exposed connections with electrical tape. Wrap the repair in additional electrical tape or heat-shrink tubing to keep the wires tightly together.
Make sure to find a power cord that exactly matches the damaged one; never mix two-prong and three-prong cords. Use wire cutters to make a clean cut through the cord. To strip the wires, use the cutters to make a small incision in the plastic tubing, and then rip it and pull it off. Be careful not to clip any of the wires while doing so. If the individual wires are also covered in plastic tubing, strip these off as well.
If you are using heat-shrink tubing to cover the repair, cut a small section for each of the individual wires and one to fit over the whole cord, and slip them over the wires and cord respectively. If it is a three-prong cord, first find the grounding wire, which is usually colored differently than the other two, and connect it to the new cord's corresponding wire by twisting them together. Do the same for the other two wires.
Slip the heat-shrink tubing over the connections and apply a heat source to melt the plastic for a snug fit, then repeat to cover the whole repair. If you're not using heat-shrink tubing, use electrical tape to wrap the connections and repair, leaving no exposed wires.