If you have spokes in your wheels and do not own a BMW or Moto Guzzi, you have tubes in your tires. Tubes mean that you can run low pressures in your tires without them coming off the rim, but you also run the risk of a nail causing a flat without any warning that will deflate your tire in seconds. If that happens you have to get out of traffic very quickly.
If the nail did not tear the tube, you might be able to temporarily seal the leak using a large tube of Slime so that you can get back home, assuming that you have a small bicycle air pump with you to re-inflate the tube. Otherwise you will have to remove the rear wheel, break the tire bead and remove one side of the tire from the wheel, pull the tube out of the wheel, install a patch or a new tube, re-install the tube, remount the tire and replace the wheel to get going again.
If you have tubeless tires, like the Zero S or Empulse R, all you need to do is to plug the tire to seal the leak with a commercial tire plugging system, re-inflate the tire and be on your way. That is why I really like tubeless tires. Not only are they easy to repair, but when they do pick up a nail, they deflate very slowly and it may even take several days for the leak to be noticed. Plus, they are easier to mount on the wheel and tend to run cooler, weigh less and you don't have to replace a $15 tube when you change tires. I was very happy when I noticed that the Zero S came with tubeless wheels.