If a tire goes flat while you are riding and you must stop, you should:

If either of your tires go flat while you are riding, hold the handgrips firmly, ease off the throttle, and maintain a straight course. If you need to brake, gradually apply the brake to the tire that is not flat. As you slow down, edge to the side of the road, squeeze the clutch, and stop.
DMV Writen Test