Nothing is 100% effective in preventing you from getting a flat tire on your bike. You do, however, you have a number of options that can greatly reduce your likelihood of getting a flat. With this advice and/or products, you may never need to fuss with tube punctures or patch kits again.
Your first strategy should always be to make sure you are riding with the proper tire pressure.
Each tire has a preferred air-pressure range, which is measured in psi (pounds per square inch). Look on the tire sidewall for the recommended pressure. As a general rule:
Road tires should run between 100 to 140 psi.
Mountain bike tires should run between 30 to 50 psi.
Urban and casual bike tire should run between 60 and 80 psi.
Under-inflation can lead to problems with "pinch flats." This can occur when you hit a bump and your under-inflated tire compresses all the way to the rim, causing 2 small holes that resemble a snake bite. Over-inflation, on the other hand, doesn't cause flats although it's possible to blow out the tube in extreme cases.
Use a tire pump or gauge to check your pressure. Higher-end tire pumps will include a psi gauge, but if you have a lower-end pump, you'll need to carry your own tire pressure gauge. Be sure to know whether you have a Presta or Schrader valve stem (the slimmer Presta valve needs to have the top nut unscrewed before checking pressure).
Basic Tire Care
It's a good idea to periodically inspect your bike tires for embedded glass, rock shards or other sharp objects, especially after riding a route that has substantial debris. These small embedded items may not cause an immediate flat but can slowly work their way through a tire to eventually cause a puncture. Use your fingernail or a small tool to remove this debris before it causes a problem.
Periodically check your tire sidewalls and tread for excessive wear, damage, dryness or cracking. Tires with any of these symptoms increase your risk for a flat tire. If unsure about their condition, ask a bike pro at your local REI or other reputable bike shop to evaluate your tires.