The Speedometer cable gear is really easy to change. Just make sure you get one with the same number of teeth, and the same color or it will change the calibration, "speed" of the speedometer.
The speedometer drive gear inside the transmission requires the output shaft to be removed, or the transfere case to be disassembled enough to reach the gear.
Both the cable and drive gears are plastic, and requires you to replace them with the same color, and number of teeth, otherwise it will change the calibration "speed" of the speedometer.