As part of a regular training routine, you are probably already working on your efficiency - getting the most distance out of each swimming stroke at the fastest speed. Maximizing your distance-per-stroke (DPS) is the first part of swim tempo training. The next part is maintaining that DPS (or as close to it as possible) and varying your stroke rate or swimming tempo to find what works best for you.
Here's an example: If you take 25 strokes when swimming 50 meters, you are getting 2 meters/stroke. If your rate is 2 seconds/stroke (or 30 strokes/minute), 50 meters will take you 50 seconds. Increase your tempo to 1.75 seconds/stroke (or 34 strokes/minute), without losing any distance per stroke, and your time drops to 43.75 seconds for 50 meters. With practice and the help of someone observing you during races, you can determine what stroke rates work for you in various situations. The tempo you maintain for a given set of repeats versus a race will not always be identical, but you can do sets at race tempo once you learn what that race tempo is. Conversely, you can work on learning to swim at a faster tempo, then transfer that to a race.
One useful tool is the Tempo Trainer from Finis. This little wonder fits under a swim cap or goggle strap and beeps at intervals you set, working like waterproof metronome. It is adjustable in 100th's of a second units; other than the simple time adjustments, the unit has a small time display.
The Wetronome is similar to the Temp Trainer but I found it easier to use because of its simplicity. It has two parts, the "beeper" and a magnet used to set the beeps. You wand close to the beeper the same number of times as the desired stroke rate, and it is set. For example, one-two-three, pause, one-two and it is set for a rate of 32 beeps/minute. It uses other beep tones to tell you it is on, set, reset, etc. The Wetronome can be clipped under your goggle strap or under a swim cap and is easy to re-program in the middle of a workout without removing it from the swimmer.
You can also watch a pace clock or stopwatch, count out a beat, and then swim while keeping that count going in your head. But, if you are like me and lack the rhythm gene, one of these tempo aids will do the trick for you.