I have been been meaning to replace my brake cables for sometime several months, and I figured as while as I was doing it, I might as well write a guide on how to do it as well. Before you start replacing your own brake cables. Read all the directions all the way through, and make sure you have everything you need first.
First off you need need Cables.
Teflon grease.
Cable ends.
Something to cut the Cable Ends.
And a 3 Way Hex Key.
It is nice to have a towel.
We are going to start off with the front brake.

You will start off by opening the the hex bolt on the side of your front caliper, and then removing the existing cable that’s already there. You cut off a cable end if there is one there already.
Now open up the front of the shifter and this is what you are looking for.

You are going to pull that all of the way out, pay attention where you pulled that cable from. You take that white bushing that the arrow is pointing to and put Teflon grease on the sides and top of it, then put that bushing on your new cable like so.

Next you rub Teflon grease on the side of your cable, it will help it last longer. Then you stick the cable back into the hole it came from. Sometimes you have to move the cable around to find the hole, the is also part of the reason you lubed it. Once you have fed the cable out of the bottom. Pull it out of the bottom and screw your adjustment screw all the way in before adjusting your brakes.

Cut off about “2 fingers” of cable. and put on a cable end. 
Tighten as needed, and there you have it. You did the front, now for the rear.
The beginning is the same, you will start off by opening the the hex bolt on the side of your back caliper, and then removing the existing cable that’s already there. You cut off a cable end if there is one there already.
Now open up the shifter and this is what you are looking for.

Pull that bushing out. Lube it up with Teflon grease like last time.

Cut off about “2 fingers” of cable. and put on a cable end. Tighten as needed, and there you go.
Now make sure both levers have about the same amount of movement. Try to stretch them as well and make sure they stop the bike consistently. Also make sure your weight does not move the handle bars.
. 
If there are any questions don’t hesitate to email, oh and wash forget to your hands once you are done, the cable ends are lead and I don’t want to be responsible for that.