When it comes to knowing how to change a tire, the most important thing is to know how to do so safely. Driving on a flat tire can damage the wheel and destroy the tire, however it's important that your car is located well out of traffic and on level ground when you stop. Turn on the hazard lights to warn other traffic, and make sure that the car is in park (or in gear if you have a manual) with the emergency brake on. If you aren't comfortable changing a tire or are unable to do so safely, call a tow truck.
Before starting assemble everything you need. Locate the jack, lug nut wrench and spare, and check that the tire is properly inflated. If you have locking wheel nuts, ensure that you have the key. Find something suitable like a rock or piece of wood to chock the wheels. Some cars don't have spare tires, but instead come with run-flat tires or a can of tire sealant. These are temporary solutions that should get you to a garage where you can have the tire repaired or replaced.
The jacking points are sometimes marked on the side of the car near the wheels, but you can verify their location by consulting the owner's manual. If there is a hubcap or wheel cover, remove it if necessary; some come off with the wheel nuts. Ensure that the jack is on a flat stable surface and lift the car slightly to remove some of the weight from the wheel. With the tire still on the ground to prevent it from spinning, crack the lug nuts. Raise the car so that the tire is completely off the ground, making sure that the jack remains straight. Remove the lug nuts and slide the wheel off the hub. If the wheel seems stuck you can give it a few kicks to loosen it up.