I have quite intelligent friends who could write horribly complicated computer programs, but wouldn't even attempt to repair a flat bicycle tire. I think it's because there aren't enough HOWTOs on the subject.

Bicycles are at the cusp of mechanical complexity that can be understood without special training - mechanical watches are on the other side of the threshold. As such, everyone should be able to change a flat tire.

Below are instuctions on how to fix a simple flat, where the tire is still useable. If you have a bad flat, where you have a big gaping hole in your tire, you outta luck (unless you actually carry a whole spare tire, instead of just the inner tube...)

Stuff you need to fix a flat bicycle tire

Stuff that makes it easier to fix a flat

Instructions

  • First, get off the bike. Stop before you do. Continuing to ride your bike with a flat tire is dangerous. You'll lose control, and you'll damage your rims.
  • Remove the wheel on which the tire is flat. This is easy if you have quick-release hubs. Otherwise, get out the wrench. You may have to release your brakes in order for the wheel to come out.
  • Remove the tire. Take out most of the air form the tire, if it isn't completely flat already. This makes it easier to remove the tire. You don't need to completely remove it, just get one side off the rim, so you can get to the inner tube. This is where the tire levers would come in handy. If you have the kind with a hook on one end, you take the other end, lever it under the bead of the tire, bend it back, and hook the hook on one of the spokes. This keeps the lever in place, so you can work at another part of the tire. If you ever have to remove Continental Grand Prix tires off of a a Mavic MA-2 rim, you'll almost need the levers.
  • Look for what caused the flat. Run you fingers inside the tire to feel for rocks, glass, etc. You should be careful - you can get a little nick yourself. It's important to make sure there's nothing poking inwards through the tire, as you'll just get another flat if you don't get rid of it.
  • (optional) Patch the inner tube. Even if you have a spare inner tube, it's a good idea to patch the flat one, so you'll have a spare in case your spare gets a flat. Find the whole, scratch the rubber around the hole with the sandpaper that comes with the patch kit to remove the mold-release from the rubber. Smear some rubber cement around the hole. Let dry for a few minutes. Apply the patch.
  • Put the inner tube back in. Partially inflate the inner tube. Position the inner tube back inside the tire, starting from the stem (where you blow air in from). Make sure there are no kinks and the inner tube isn't being pinched anywhere.
  • Remount the tire. You may have to let a little air out of the inner tube. Reseat both beads into the rim, making sure you don't pinch the innertube between the bead of the tire and the rim.
  • Inflate the tire. Attach your pump or CO2 powered inflator. I've never used a CO2 inflator, so follow the manufacturer's directions. Otherwise, pump away. After the first few pumps, make sure the inner tube isn't trying to peek out from anywhere. Remount the tire if it is. You can't reach as high pressures with a frame pump as you can with a normal floor pump, so pump as much as you'd like. Once it's the tire is hard enough to ride on, you're done.
  • Pick up any trash you generated. Don't be a bozo who leaves his flats around. Flat inner tubes make wonderful luggage straps.