You can--I've done it many times--just unscrew the cable sheath at the back of the speedometer, then pull the cable out. You can then feed the new cable though the sheath and futz with it a little to get the squared-off end seated in the angle drive. Takes all of about 3 minutes. Of course, you'll get a new sheath with the cable and it's a good idea to replace both.
However, if your speedo stopped working suddenly it may not be the cable. Cables don't really wear out, though they can be kinked and, theoretically, break. But, if your cable broke the speedo itself may be locked-up--a much bigger problem. Or, you may have a problem in the angle drive.
Pull the cable out and inspect it before you shell out for a new one; if the cable isn't broken or kinked it's probably not your problem.