The cable itself is removed as follows.
Remove the speedometer cable housing from the instrument cluster.
Remove the speedometer cable housing from the transmission or transfere case.
Remove the speedometer drive gear off the end of the cable, it's held on with a "c" clip.
Pull the speedometer cable out of the spedometer cable housing with a pair of needle nosed pliers on the instrument cluster end.
When you reinsert the cable into the housing, use some speedometer lubricant, or white lithium grease. Make sure the cable is well lubricated when replacing it back into the housing.