When cycling in the countryside, you should always carry a spare inner tube with you, not for your average puncture, which you can easily repair, but in case the whole inner tube gets ripped. A simple puncture will give you a chance for a nice break in the shade under a tree while you fix it. Carry a few tools and puncture repair kit, and take a break.
Always carry a puncture repair kit, which should include a small piece of sandpaper, some vulcanising patches and some glue. You will also need a pump and two tire irons.
You'll know when your tire has been punctured because the bike will swerve on turns. Stop and confirm you've got a puncture. Turn the bike upside down and rest it on its saddle and handlebars. Remove the wheel by holding the easy-release arm and unscrewing the nut on the other side.
Getting the Tire Off
Expel all the remaining air out of the tube by compressing the tire while pushing in the centre of the valve or by unscrewing the valve, depending on the type of valve you have. Get the edges of the tire as far into the centre of the wheel as possible. There's a groove there and it'll make it much easier to get the tire irons in. Take one tire iron and leverage the tire. Do the same with the other tire iron and the tire will pop out over the rim of the wheel. Slide one tire iron all the way around until an entire edge of the tire is over the rim.
Identifying the Hole
Push the valve into the hole in the rim so you can't see it sticking out anymore. Pull the tube out and away from the wheel, and fill it with some air. Hold the tube to your ear and listen very carefully for the sound of air escaping. After you've identified the hole, roughen it a bit with the sandpaper. Apply a thin layer of vulcanising solution to an area larger than the patch you plan to use and allow it to dry.
Peel off a patch and press firmly. In an instant, a vulcanising bond will occur. The tube is ready to be filled again. Check for more holes. At the same time, run your fingers around the inside of the tire to check for whatever might have caused the puncture and remove whatever it was. This is an important step unless you want another rest stop a mile or so down the trail.
Putting It All Back
In reverse order, lever the tire back onto the rim around the tube. Make sure you don't snare the tube and cause more punctures. Fill the tube and put the wheel back on the bike. Right the bike before tightening everything up so that it all seats properly. Make the quick-release arm trail--it should point backward rather than forward to avoid snagging on trees and things on the trail. Then continue on your merry way, checking the tire periodically.