Your vehicle's speedometer (or the things attached to it) can go bad once in a while. Sometimes, it might stop reading out, others it might just read very off (too fast, too slow). Or maybe the trip meter or something similar is not working right. This happens only rarely in today's common electronic (digital) dashboards, but not all cars are using them.
Remove It (Carefully)
The first thing you'll need to do is get it out of the dashboard. This, frankly, is most of the job. Every car is different, but getting the instrument cluster off is never an easy task. Take your time and carefully label everything removed and take photographs as you go so you can reference them to put it back together.
Once the speedometer is out of the cluster, you can work with it.
Disassemble the Speedo
In a non-electronic speedometer, your problems may be in the speedo cable that runs from the front axle to the speedometer. In that case, you'll be working with that instead of the instrument itself. Most of the time, if your car is at all modern, the problem will be in the electronic speedometer itself.
Be very careful in taking apart your speedo as many of the parts are easily scratched or broken (or lost). Depending on your problem, you'll have to dig down to find the issue. It may be in the trip button, which can sometimes dislodge from its casing and no longer reset, or the odometer or trip counter itself (note: it is illegal to tamper with the odometer).
The needle may be stuck, broken, or disconnected. This is usually the most common thing to go wrong with an analog output odometer (non-digital readout).
On rare occasions, the tiny motor that operates the whole system may be the problem.
Once you've located the problem and repaired it, put it all back together in reverse order. Use your photos for reference as needed.