When the speedo cable was driven off the front wheel, it could be lubed and would last for 10 years. With new bikes having the speedo cable driven off the front sprocket it is out of sight and not lubed.
First you have to determine if the cable is broken or if the little gear box is broken. Assuming the speedometer is fine, unscrew the speedo cable-housing from the rear of the speedometer. If the cable is already unscrewed, you've found the problem, but that never happens. If you can pull the cable out of the housing, the cable is broken. If you can't pull it out, you have to assume it is not broken, and you will have to take the sprocket cover off and check out the gearbox. If the cable is broken, you have to pull this off anyway, because most cables have to come up from the gearbox.
It helps if you have a manual to work from. Although my Honda manual didn't say diddly about how to do this.