Broken, worn-out or simply ugly-looking tuners are often the cause of complaints by guitarists. If changing them is unavoidable, here is some info that will help you understand the subject better.
Before anything else, be sure to verify that the problems you're facing are actually rooted in the tuners. A tuning defect or bad sustain isn't necessarily a sign of an headstock-related issue. Adjusting the neck and the bridge (which is something that entails some risks and may require the help of a professional) is a mandatory first step before deciding to change the tuning machines, because doing so often clears up a lot of problems.
Bring in the accused
The temptation upgrade a budget guitar with state-of-the-art tuners is strong. But it is useful to know that the instrument is often adapted to certain type of tuning machines and upgrade attempts like that frequently end up in failure. By using the same type of tuners — if not the same model — you can be sure that they are fully compatible with your instrument. What's more, while the diameter of the hole where the tuners go into the headstock is more or less standard (especially for entry-level guitars), make sure to verify that your guitar doesn't have smaller holes, like is often the case in some "vintage" instruments (both on the authentic ones and the modern reissues, especially with Fender guitars).
Despite that, certain features might make you want to go up one level, to be able to use tuners more skillfully.
Soak them in oil
Usually, to get a real improvement you need to replace standard models with lubricated tuning machines. That doesn't mean that standard models are bad (some guitars from the '50s still have their original tuners in perfect condition), but rather that the "detented" feel due to dirt from multiple origins making their way into the gears won't exist with lubricated tuners. All major manufacturers, like Gotoh, Kluson, Schaller, and Grover offer this type of tuner, and the additional cost is often minimal.
Lock them up
Like locking nuts featured on guitars with a Floyd Rose-style floating tremolo, locking tuners allow you to avoid detuning by preventing the strings from slipping or stretching too much. Amateurs who like two-and-a-half-tone bends and fans of vintage vibrato are very enthusiastic about this Sperzel invention from the '80s. But installing them usually entails major adjustments to the tuner holes. As always, the wisest decision is to consult a professional who can tell you whether it's doable or not on your guitar.
Tuning and detuning
Finally, those of you who like to change tunings frequently should check out Hipshot, whose tuners allow you to go, for example, from a standard E tuning to a Drop D in one single movement. Geeks of alternative tunings will be seduced by Tronical Tune's system (available as Min-ETune on certain Gibsons), which offers customizable and automatic tuning.