Fixing a flat tire is one of the short list of skills that’s easier to learn than you expect. Also, fixing a flat tire will make you feel awesome for a solid chunk of time following, so keep that in mind when you sit down to fix a flat!
Your hands will get dirty, but in that sort of ‘behold, I am handy with tools and you should be impressed!’ kind of way (You can also put on a pair of gloves if you prefer)
Fixing a flat tire comes down to five quite manageable steps:
Remove the wheel from the bike - Release the quick releases (the little lever that holds your wheel in place) and release the brakes, and loosen whatever nut or the like may be holding the wheel in place. If it’s a rear wheel, you’ll need to carefully pull the wheel free from the chain too.
Remove the tire from the wheel - Once you’ve got the wheel separate from the bike, you’ll want a set of tire levers (two is ideal, one can work fine) to wiggle in between the tire and the rim so that you can free one side of the tire from the wheel (the idea is just to get it off the one side so you can replace the tube - no need to take the tire completely off both sides of the rim!). Honestly, this is usually the hardest part, but it’s mostly a matter of being patient (or stubborn), and just working your way around the tire with the levers until you’ve got one side pulled free.
Check the tire for any major holes, punctures, etc - Just give it a brief survey to check the inside and outside of the tire (there might be a small piece of glass or thorn stuck in the tire still. The old tube may be able to be repaired or recyclable. You could find the hole and patch it up (watch this video for patching the hole)
Replace the tube inside the tire and put the tire back on the wheel - Make sure you swap the tube with the right size replacement (the correct dimensions can be found on the outside of your tire, though it may be tough to spot), and that when you set the tire back on the wheel that you avoid pinching the tube in between anywhere. Use the bike levers to get tire on. Getting the tire back on may also be a pain, but again, patience and perseverance!
Replace the wheel on the bike - Yup, just put the wheel back where it was and tighten everything back up and close the brakes again, and you should be good to go! You’re awesome!
Since much of this is easier to replicate by seeing it, here’s a video to help!