A flat tyre is inconvenient, but changing it safely is a skill every driver should have, especially if you drive outside city limits regularly.
Pull well off the road onto flat, stable ground, turn on hazard lights, and engage the parking brake. If you have a warning triangle, place it behind the car. Loosen the wheel nuts slightly with the car still on the ground — it's much harder to do once the wheel is lifted and can spin freely.
Position the jack at the correct jacking point specified in your owner's manual (never under the plastic underbody trim), and raise the car until the flat tyre is a few centimeters off the ground. Remove the loosened nuts fully, pull off the flat tyre, and mount the spare in its place.
Hand-tighten the nuts in a star (criss-cross) pattern, not sequentially around the circle, to seat the wheel evenly. Lower the car back down, then fully tighten the nuts in the same star pattern with a wrench for real torque. Drive cautiously to a workshop to have the nuts properly torqued and the flat repaired or replaced — most compact spares are also speed and distance limited, so check yours.