you can only change the cable if the lever is in the correct position. Switch onto the highest gear, then pull the brake lever. You should be able to see the nipple on the end of the gear cable (look straight down into the back of the hood). Push the cable back through the outer, and it should just pop out.
Replacement is the opposite, but can be tricky as the cable nipple has to sit in exactly the right place to seat properly, or the brake lever wont return to normal position.