A clean and well lubed drive train will go a long way towards keeping your bike working well. Most people understand this is important but aren't sure how to go about it. I have a simple system that will save time and keep your parts working better. There are two ways to clean your chain: on the bike or take the chain off the bike.
On the Bike Method
Items Needed: Bicycle Chain cleaning device or bristle brush, degreaser and chain lube
Step 1: Shift your chain into the big ring in the front and second hardest gear on the back.
Step 2: If you are using a chain cleaning device, fill the reservoir with degreaser and then clip the chain cleaner onto the bottom strand of the chain below the chainstay. If you are using a brush, pedal backwards and get a good coating of degreaser on your entire chain.
Step 3: With the chain cleaner on the chain, hold it in place and pedal backwards 10-20 times. The brushes and wiper in the chain cleaner will get the degreaser all through the chain and clean off the crud. Remove the chain cleaner and dispose of the dirty degreaser at the appropriate waster material depot. I keep an old glass jar that I will take to the local auto repair place to dispose of as they deal with waste products like these regularly. Don't just dump it down the sink.
If you are using a brush, hold the brush against one side of the chain and pedal backwards 5-10 times. Repeat this for each side of the chain. Top, bottom, right side and left side. With a clean dry rag wrap it around the bottom strand of chain and pedal backwards to get all the loose dirt off. Keep switching to clean sections of rag until you are getting almost nothing more off.
Step 4: Rinse off the chain with rubbing alcohol. A squirt bottle filled make a great applicator for this. Pedal backwards and spray the chain to get the degreaser film off. Wait for the chain to dry.
Step 5: Re-lube your chain. Pedal backwards and drip lube on each link. Once you've got the whole chain coated, pedal backwards 10-15 times to work the lube into the chain. Wipe off the excess with a clean rag. If you ride in dry, dusty conditions run a blow dryer on the chain for a couple of minutes to make the surface coating dry. This will reduce the amount of dust that sticks to it.
I suggest a cleaning like this at least once a month or when every you ride in the wet.
An alternative method if you are a bit lazy is using Rock and Roll Gold lubricant. Just apply the lube to the chain, pedal backwards to work it in and then thoroughly wipe off the excess as it also lifts off dirt like magic.