One of the worst situations in cycling is produced when riding a bike and suffering a puncture without the proper tools to repair it. In that case, the best you can do is calling somebody to help you or walking while pushing your bike. But lets be positive and think about what you can do if experiencing a puncture and do have tools. In such a situation, you need tire levers, a spanner (in case you do not have quick-release wheels), a bike pump and a repair kit. The process has two parts: Dealing with the inner tube and fixing the puncture.
First of all, take a look at the tire and remove whatever object that has caused the puncture like a thorn or a nail. Then, loosen the wheel nuts with a spanner, or undo the quick release bolts if your bike has them, and check that the inner tube is deflated. Continue with grabbing the wheel on the opposite side to the valve. Move the tire around some inches, repeat it with a second lever and repeat this process by using two or three levers. Finish this first part by removing the inner tube and checking its inside to confirm that whatever caused the puncture is gone. This last step is important.
Second, repair the puncture. Find where the puncture is either by listening for air or putting the tube in water and looking for bubbles. It is a good idea to mark the hole with a crayon or a pen. After that, roughen the area around the hole with sandpaper, then stick on the patch from the repair kit. Some patches are pre-glued, while others come with a separate tube of vulcanizing solution or rubber cement so stick them on with. Then, put a small amount of air in the tube, put it back into the wheel and tuck the tire back over the wheel rim. Push the valve back into the hole, seat the tire and pull the valve back through. Finally, pump the tire back up to the correct pressure and put the wheel back on the bicycle.
Due to the fact that it is much easier to just replace the inner tube if you puncture when riding, it is a great idea to carry a spare one while enjoying your bike.