1. Don't stretch your luck
Your chain doesn't actually stretch. The holes in which the pins connect the individual links begin to become oval over time and eventually change the tolerances of the chain. When this happens, the worn chain will begin to wear the teeth on your chainring and cassette. You'll know your drivetrain is worn when its teeth start to resemble shark fins (if you let it deteriorate this much, replace your cassette and chainring, as well as the chain). But to avoid this, keep track of your chain's wear and replace it before it has a chance to destroy your drivetrain. To measure, line up the first line on a 30cm ruler with the centre of any pin and place the ruler carefully along the chain. The last line on the ruler should also fall in the centre of a pin, though you have a little leeway.
2. Wear the right chain
For a smooth ride, it's essential to run the correct-width chain relative to your drivetrain. Chain sizes are standard, and are listed on the chain's packaging. To work out a chain's size on your own, line up the jaws of a pair of calipers over the centre of the ends of a chain pin. Five- or six-speed bikes need a chain with a diameter of 7.5 to 8mm; seven- and eight-speed bikes need a chain with a diameter of 7 to 7.5mm; and nine-speed bikes need a chain with a diameter of 6.5 to 6.9mm. The most commonly used chain, the 10-speed, needs a 5.9 to 6.1mm chain. It's best to stick with the same brand for your chain and your drivetrain, especially when you get into the nine- and 10-speed range.
3. Stop sucking up
You'll know when it happens. You're riding along and suddenly your pedals lock up and you're forced to stop abruptly. You've just experienced chain suck - when your chain doesn't disengage from the bottom teeth of the front chainring and instead gets caught up on the teeth and pulled back up the ring onto itself, jamming between the chainrings and the chainstay. Common causes include a worn chain with stiff links, bent or damaged teeth on your chainring, mud or wet grit on your chain and cassette, a misaligned chainline (how your chainrings line up with your cassette), or changing gear late under pedalling load. If you don't work out the cause, and fix it, you run the risk of damaging your frame and drivetrain components.