Don't despair: when you're faced with a flat tire, you should assume that it can be repaired.
Many times people will request that a tire be replaced even before it has been inspected. If a punctured tire is properly evaluated and repaired according to a few minimum standards, there is no reason that it can't provide you with months, if not years, of additional service.
Before we get into what to look for in the repair process, let's mention some conditions that even the best tire technician can't repair. A hole in a tire any larger than 3/8 of an inch should not be repaired, as is the case with any tire that has a damaged inner liner. This usually happens when a tire is driven while flat. A telltale sign of this type of damage is dust accumulating on the inside of the tire as the liner degrades.
Tires with injuries to the sidewall should usually not be repaired. This is also true if the tire exhibits any additional damage to the sidewall like cracking or dry rotting. Tires that have suffered a puncture in close proximity to a previous repair should be replaced.
My preferred type of patch is actually a patch and plug combination. This method of repair requires that the tire be dismounted from the wheel and patched from the inside. The bonus of this approach is that it gives the technician the chance to inspect the inside of the tire for some of the conditions mentioned above. For this reason it is unacceptable to repair a tire from the outside with a plug while never dismounting the tire from the wheel.
The preparation process of the combo repair is to drill out the puncture hole with a cutting bit and to clean and buff the area surrounding the hole. The plug then fills up the hole and prevents moisture from seeping into the tire and rusting the steel cord. Meanwhile the patch reinforces the area adjacent to the hole.
One reason not to use this approach is if the object enters the tire at an angle greater than 25 degrees. The fear is that the plug part of the combination patch will dislodge from the patch due to the angle. For these types of punctures it is recommended that a patch-only repair be made.
If you can get over the initial shock of finding a flat and you make sure you don't drive on the deflated tire, there is no reason that it can't be put back in service for many additional miles.