Why did the speedometer and odometer stop working in a 97 suzuki sidekick?

Most likely the speedometer cable (that works both the speedometer and the odometer) broke. Not unusual in older vehicles. Was the speedometer needle jumping around a lot before it stopped working? (Like, if you were doing about 50mph, did the speedometer gauge swing back and forth between 45 and 55?) If so, that was an indication the cable was binding up within its sheath...it would bind, the gauge would start to drop, then the extra pressure of the bound cable would break free, the gauge would leap up. Usually this means the cable didn't have sufficient lubrication.

I used to have Samurai's, not Trackers. Samurai's speedo was driven off a gear on either the trans or transfer case, but Trackers I think use a speed ring on the rear differential.

If you can get the cable out it's easy to tell if it's broken...twist one end of the inner cable and the other end won't twist. You may even be able to pull the cable out of its sheath.

You might want to try to buy a replacement cable off a junkyard wreck (making sure of course that IT isn't broken), and then go to a bicycle shop and ask what they use to lubricate bicycle cables (brake and shifter lines), and lube your replacement cable before you install it.

I'm really shooting in the dark here, it might be something completely different. However, having owned A LOT OF OLD HIGH MILEAGE cars, I've had speedometers break about 4 times. 3 were broken cables. The 4th was a broken speedometer itself, which made the most godawful screech and grinding noise I've ever heard in a vehicle, immediately before stopping working.

Good luck!