My tire was flat and I could not fix it, so I had to carry the bike all the way. How could I have fixed it?
Well, it's a complicated question, because there are several different cases to consider:
- The tire is simply flat because the air leaked out slowly.
- There is a hole in the tire due to a nail or thorn or shard of glass.
- There is a large hole or cut in the tire.
The first thing you need is a pump. Sometimes (but not usually) you can pump up the flat tire and it will hold air for 30 minutes or so, allowing you to ride home or at least letting you ride for several minutes before you stop and pump it up again.
The normal case is that there is no obvious damage to the tire, but when you try to pump it up it doesn't hold air. Then you need the pump, "tire irons", and either a patch kit or a spare inner tube. You may also need wrenches to loosen your wheel, if it does not have a "quick release".
The procedure is to remove the wheel from the bike, then use the tire "irons" (most of which now are actually made of plastic) to pry one side of the tire off the rim. (This procedure is a bit more complicated than that statement -- it takes practice to do without damaging the inner tube further, and an entire article could be written on this topic alone.) Then remove the inner tube from inside the tire.
At this point, even if you have a spare tube, it's wise to attempt to find the hole in the old tube and then look at that spot inside the tire to see if there's still a nail or thorn sticking through.
Using spare tube
Then, if you have a spare tube, you install it in place of the bad one (pump a little air into it first to make it round), use the tire irons to get the tire back on the rim, and then pump up the tire. I like to pump it up once, deflate it, and then pump again, to help position the tube and "seat" the tire on the rim. Once it's pumped up examine the wheel for any obvious lumps (indicating the tube may be twisted inside) and to see that the tire is evenly installed on the rim.
Using patch kit
If you don't have a spare tube (but DO have a patch kit), you should attach your pump to the old one and try to pump it up. Air will exit the leak, and you can hear/feel the air escaping. Mark the hole somehow -- a pencil, a ballpoint pen, or a piece of chalk will work. But note that you will be cleaning the area around the hole, so make marks well away from the hole that you can line up to locate the hole after cleaning.
Read the instructions that come with the patch kit. Usually you clean around the hole using the sandpaper that comes in the patch kit, spread glue (also in the kit) around the hole and let it mostly dry, then attach the patch over the hole. Then it's usually wise to wait 5-10 minutes before inflating (though during that period several times pressing the patch tightly against the tube). It's probably a good idea to then inflate the tube a bit to be sure that there are no more holes and that you covered the one hole correctly.
I like to spread some chalk powder or simply a bit of dust from the ground over the patch area to keep it from sticking to the inside of the tire.
Reinstall the tube the same as with the spare tube.
If you discover that you have a large hole or cut in the tire then it's necessary to use some sort of "boot" inside the tire, to keep the new/repaired tube from bulging through the hole. Of course, some holes are simply too large for this to work, but usually it's worth a try regardless of how big the hole is.
For a boot you want a piece of thin but relatively stiff/strong material. Special strips of reenforced rubber are sold at bike shops for this, or you can cut a section from the side of an old tire. A popular technique in the US is to use a folded-up dollar bill -- the paper that the US dollar is made from is quite durable and stiff, and, if a relatively new bill is folded into four layers it works quite well for small or medium holes.
To use the boot you get the tube repaired and installed, and just before you put the tire back on the rim you work the boot in between the tube and tire so that it covers the hole. Then put the tire back on the rim and inflate.