Acknowledge that you have a flat tire.
A flat tire means deflated even without rider on the bike. If the tire is flat as soon as you get on it, it's not properly inflated. In general, the pression should be at the maximum (less wear, less risk of puncture, more speed, less efforts).
Note the size of tube needed and optimum tire pressure.
It is best to know this ahead of time so you have the information for the later steps.
Disengage the rear brake before you remove the rear wheel.
Pinch the arms to compress the brake cable.
Pull the cable out of the lever and it will fully release.
If your break does not have a quick release (as shown in the picture) you may have to loosen the nut securing the brake cable to open the brakes.
Unscrew quick release lever found where the bike frame is attached to the rim of the tire.
Turn the lever then the quick release cap will unscrew "lefty-loosey".
Once it is loose enough you can pull the tire off, but do not pull it yet entirely off.
If your bike does not have a quick release for the wheel, you will need to unscrew the axle nut.
Some anti-theft nuts require turn the bike upside down, other need a special wrench. However, you'll know best if you have bought such an anti-theft device.
Remove chain from sprocket.
This isn't that hard, just spin the tire slowly to help while taking the chain off. But it's a dirty work, gloves or something to wipe you off could be a good idea.
Pull tire and rim off of bike.
Pinch the tire and separate from rim. A metallic or plastic tire lever can be useful.
I remember getting the tire off the rim was difficult. There are special levers to help pull off the tire. You use three of them to pull the rim off, inserting one after the other and sliding them to the side.
Pull out punctured tube from tire and replace with new tube.
Alternatively you might want to patch your tube's puncture.
Put the tire back on the rim
Make sure the hole in the rim lines up with the valve on the tube properly.
Re-attach rim to the bike frame. Put the chain and push the tire on the fork leg.
Make sure the chain aligns with the sprocket.
Tighten quick release lever and lock.
Re-attach the rear brake.
Reference step 3 and follow in reverse.
Pump the tire up to the specified pressure
This tire is supposed to be at 40 PSI