To fix a bicycle flat tire is easy. The tire is the part that sits on the wheel which is the metal frame. A tire has contact to the road while riding.
The rim is the side of the wheel. The tube sits inside the tire and is made from rubber and is filled with air. The tube can get damaged by nails, glass or other things on the road. If this happens the air will get out of the tube and you have a flat tire.
If the tire (tube) is damaged
Stop riding or you damage the wheel rims. Let the air out of the tube and remove the wheel.
You can sometimes let the wheel as it is and just open the valve to let the air out and fix the tube without taking off the wheel. I do this all the time.
But you might find it easier to fix the tube if you take the wheel off. To do this it helps if you turn your bike upside down. Remove the nuts with a wrench and take the wheel off.
I always leave the wheel on and pull out just parts of the tube along the edges of the wheel. Then I fill them with air and hold them in a bucket of water to find the hole.
But if you are a beginner it is better if you take the wheel of first.
How to take the wheel of?
Then I get a bucket of warm water pump up the tube and hold it into the water to see where the hole is.
When you see the bubbles in the water you know where the hole is. Take out the tube, make it dry and clean just at the hole and aound it, then apply the clue.
Wait for five minutes, then put the rubber patch on the hole and press very hard on it to fix it properly.