During my last ride, my front derailer cable gave up on me and froze. I use this all the time on rides so I was thankful that it waited until we neared the end of our third day of riding. Here are the steps to change a cable on a bicycle. Each bike manufacture is going to be a little different, but these should provide you some guidance in general. Worst case you have to take your bike to a bike shop and pay for the repair, so go for it!
Step 1: Replacement Cable
Locate the correct cable for your bike. Stores like Wal-Mart and KMart often times have universal cable kits which ended up working great for my particular bicycle.
Step 2: Cable Path
Before removing the old cable, take note of the path of the old cable. After a cable is out it might be difficult to determine the correct path when threading the new cable.
Step 3: Remove Old
Ok, now that we have a clear picture of the path of the old cable, it is time to remove the old cable. If the cable runs through any of the bike's tubing, you may want to consider connecting a string to one end so you can pull the new cable through a difficult area. This was not necessary on my bicycle, but could be an issue on yours.
Step 4: Compare
Once the old cable is off, lay the old cable and new cable side-by-side to compare for differences. If it is not the precise cable you may need to cut the cable to length*. I recommend cutting the cable a bit longer than the old one just in case. "Measure twice, cut once" is a good motto. If you end up cutting the cable, fit the cut end of the new cable with metal end that comes with kit. This is what the cable pushes against and without it your new cable will fail prematurely.
Step 5: Thread New Cable
Thread the new cable along the path of the old cable.
**Sometimes it is easier or necessary to thread the outer cable housing separately first and then insert the inner cable once the housing is in place. Use your best judgment for your specific application.
Step 6: Cable Length
Make any final adjustments to length.
Step 7: Adjustment
If dealing with a gear cable, be sure to leave the control lever and the actuator in the proper relationship before clamping down the cable. I found that I had to make several adjustments before I had the cable where it should be for proper travel and control. Some bikes have threaded adjusters that allow you to fine tune cable / gear alignment after the cable is locked in place. In my case the real de-railer has this feature, but the front one does not so more care needs to be made when clamping down the cable on the front de-railer.
Step 8: Final Adjustment
Take the opportunity to lube the derailer so the new cable works effortlessly. Crimp end on cable to keep cable from fraying. This can be done by pinching the small metal sleeve over end of cable and pinching with a pair of pliers.
Step 9: Test Run
Take several test-runs before any major rides. Make sure your able to reach all the gears and that it behaves reliably when shifting gears.