Understand the Terms.
- The Tire is the round rubber circle that actually makes contact with the road.
- The Wheel is the metal frame that the tire sits on.
- The Rim is the side of the wheel, where the tire lip rests. (The part that the brakes grab on to.)
- The Tube is the rubber thing that's filled with air.
Stop riding. Even if there's still "some" air in the tire, stop riding your bike, otherwise you'll damage the wheel rims. (Unless you don't mind buying another wheel.)
Empty the tube. If there's any air left in the tube, release it by pressing on the valve.
Remove the wheel. It's easier to take the wheel off if you turn your bike upside down first, so do so. If your wheel isn't quick release, then remove the nuts with a 15mm box wrench or a crescent wrench. You may have to release your brakes to get the wheel to move through the brake pads. (Squeeze the brakes together, then unhook the brake cable.) Note that it's possible to patch the tire without removing the wheel, but the hassle you save by leaving the wheel on might not match the added hassle of trying to fiddle with patching a tube that's still on the bike.
Remove the tire. Use a plastic tire lever to move the lip of the tire over the rim, on one side of the wheel. (Plastic tire levers are cheap, and bike shops sell a more elaborate model that hooks onto the axle for super-easy tire removal.) Once you've done the whole side, you can pull the tire & tube together off the rim. Thicker tires are easier to get off and on (e.g., mountain bike tires are much easier than racing tires).
Remove the tube. Before removing the tube, mark on the tire where the valve was positioned. That way when you find the leak in the tube, you can check the corresponding place in the tire to see if the culprit is still in the tire.
Patch or Replace. You can either replace the whole tube or patch it, unless the hole in the tube is really large (blowout), in which case you have to replace the tube. Both tubes and patch kits are cheap at your local bike shop, though patch kits are a little cheaper. If you go with patches, get the regular kind (black dot with a red border), not the glueless patches, since glueless patches often don't stick well. A properly-applied regular patch will last forever. There's no limit to the number of patches you can put on a tube, though once a tube has several patches you'll probably want to replace it because with several patches it's more likely than one of them will come off. Don't try to use a bit of old tube as a patch; it's too thick and will give you a bumpy ride, if it even bonds properly at all.
If Patching...
Find the leak. Forget about putting the tube in the bathtub to find the leak. Simply pump the tube up to a slightly over-inflated size so it's bulging. You'll find the leak, and it won't permanently stretch your tube.
Draw a circle and an X on the tube to mark the hole. (Submerging in water is only useful when you suspect that you have a bunch of tiny punctures from riding through a sticker patch -- and if you do, of course you'll want to just replace the whole tube instead of patching it.)
Prep the tube for patching. Release all the air again. Use the sandpaper or metal file that came with the patch kit to scrape the hole area really well. This will allow the glue to bond better.
Apply the glue. In a well-ventilated area, apply the glue to the leak area, to an area slightly larger than the patch. Wait for the glue to dry before applying the patch! This may seem counter-intuitive, but you won't get a good bond if you put the patch on wet. Try not to breathe the glue vapors; it's not good for you.
Apply the patch. Don't remove the clear plastic on the patch yet. Apply the patch to the tube, and mash down really hard. You may prefer to stand on it. Apply pressure for at least 60 seconds. THEN remove the clear plastic. If the patch comes off when you remove the plastic, you need to work on your technique (better sandpapering, more glue, wait longer for glue to dry, apply pressure for longer period of time).
Find the cause of the flat. If whatever caused your flat is still in your tire, you'll get another flat right away.
Did the tire fail? (i.e., Is there a big hole on the tire where part of it flaked off?) If so, you'll need to replace your tire. In an emergency you can place a "boot" between the tube and the tire, using a dollar bill, cut pieces of an old tube, or a special boot patch that you can buy at a bike shop.
If the tire didn't fail, find the puncture. Match the location of the leak in the tube with its sister location on the tire. If you don't find it, run your finger slowly through the inside of the tire feeling for a tiny bit of glass or wire. If you don't find anything, check the wheel itself for sharp spots or rust.
Replace the tire with an Armadillo? Switching to an Armadillo tire will help prevent future flats. (See the next section on Preventing Flats.)
Install a tire liner or Slime? If you didn't opt for an Armadillo tire, than you might consider at least installing a tire liner and/or Slime, to prevent future flats. (See the next section on Preventing Flats.) Note: Once a tube has been slimed, always make sure the valve is pointing down (12 o'clock position) before putting air in it. This keeps the slime from trying to get out.
Reinstall the tube. Put a little air in the tube, just enough to give it a little form, and put it into the tire.
Reinstall the tire. Stick the valve through the valve hole. With your fingers, work the lip of the tire into the wheel rim, on only one side. You may need to use a tire lever for the last bit. Once you've done one side completely, do the other side. Be careful not to pinch the tube between the tire and the rim, especially when you're using the lever.
Reinstall the wheel. Put the wheel back on your bike. If your wheel uses nuts, then alternate between each side a few times as you tighten -- don't tighten one side completely before starting the other. If you have quick release, make sure you put it on tight enough. It's tight enough when the quick release lever offers some resistance and leaves a mark on your hand. After you put the wheel on, tug on it pretty hard to double-check that it's not loose. Also make sure it's on straight -- if it's rubbing on the brakes when it spins, it'll be a lot harder to pedal.
Inflate and Release. Pump up the tire, then let most of the air out again. This will help work out any kinks where the tube might have been pinched.
Reinflate the tire. Inflate the tire until it's very firm. You should be able to just barely make a small dent in the tire by pressing on it with your thumb while your fingers hold the wheel under it.
Put the valve cap back on. This will help keep the air in if the valve has a slow leak.
Reconnect the brake cable. Don't forget this part!