Well having experienced sudden deflation of both the front and rear tires I can say both are surprising and exciting! It takes a moment to know what is going on, specially if you have never experienced one.
When you start to experience looseness or weird handling, the main thing to remember is be calm and try not to have a death grip on the bars, or do anything abruptly. Relax and just slow down gently using the appropriate brake as already mentioned.
For rear flats clutch disengagement is a good idea
after you are at a neutral throttle setting. The main thing is no sudden application of brakes, throttle, or engine braking.
Rear flats are more nerve-racking in my experience, depending on the bike trailing throttle can stabilise the bike until things settle and you can stop.
I have found front flats less traumatic, I think the lower profile tires help. The main reason they are easier to manage is that you can instinctively control the direction that the tire wants to go with the bars, of course, it works best when you shift your weight back.
On one occasion I rode sedately over 20 miles with a flat front tire! It was on a dirt bike with a lowish profile front tire and yes, about 3 miles was on dirt. I was thinking to myself as I rode home "this was the first time I've ridden my bike under the speed limit" glanced at the speedo ....... whoops I was still speeding slightly!
I could never have done that on a flat rear.
Something worth pointing out.... once you get stopped, if you don't have a flat, give the bike a close inspection for leaks and loose fasteners. Check your fluid levels too. A friend of mine thought he had a flat on his liquid cooled bike, stopped and checked his tires. They looked fine so he just jumped on and kept riding.....about 3 miles........until his engine lost power up a hill and seized!
His coolant drain bolt had dropped out and he had self lubed his rear tire causing that loose feeling. A VERY expensive lesson.