Rack and pinion gears are used to convert rotation into linear motion. A perfect example of this is the steering system on many cars. The steering wheel rotates a gear which engages the rack. As the gear turns, it slides the rack either to the right or left, depending on which way you turn the wheel.
Rack and pinion gears are also used in some scales to turn the dial that displays your weight.