Jim sums it up pretty well.
1. Always use premium fuel (91 to 93 Octane in the states.) If you must use less than premium, try not to fill up and fill up with premium as soon as possible -- this prevents engine knock.
2. Pick a good gas with a good detergent, the links give some recommendations but there are others
http://www.toptiergas.com/retailers.html
http://autorepair.about.com/od/generalinfo/a/110305.htm
If all you want is the low down stop and read no more.
If you are using a local gas say sheetz, liberty, Wawa, Racetrack, etc. They may not have the best detergents added and probably add the minimum additives for compliance with existing laws. In those cases a good system cleaner should be used about once a year. In the tank, techron concentrate is about the best -- Chevron has some others that are cheaper (Pro-Guard) with less Techron. There are others but beware of cleaners that are mostly kerosene or Naptha spirits. If it costs $2 it probably is kerosene.
The 3m system Jim mentions is the great but costly. For $150 for the kit and about $20 for the refills you can use Chevron Techron Gas exclusively for a few years or about 10 years worth of techron concentrate twice a year. But if you know someone who has one ... it is the way to go. Some service centers use them and charge about $40-50 for a one time cleaning.
Final note some local gas companies (here in VA, Wawa and Sheetz) are low on detergent additives but have other advantages. Most Sheetz and WaWa's are relatively new with the best state of the art pumps and tanks. The pumps actually monitor the gas for particulate and water and will shut down and or switch supply tanks if they exceed the allowed specification. Rumor is that Sheetz has been trying to license with Chevron or Citgo to use their detergents (Texaco merged with chevron in 2001 and began using techron in 2005.) Because they are a volume seller, the appropriate seasonal formula is usually readily available while some "name" stations do not cycle out their tanks as frequently.
hope this helps,
ATB,
Tom