How to do it?
1. LIGHTS OFF! You should not have your target illuminated for too long anyway.
2. MOVE IMMEDIATELY, AND GET DOWN!!! As has been said before, if you can take cover. And remember the difference between COVER and CONCEALMENT: Cover stops bullets. Concealment simply hides YOU, and may or may NOT stop a bullet.
As you move, get down. You don't have to go prone. Simply dropping to a crouch or one knee down will do.
3. PRACTICE, THEN DO, THE TACTICAL RELOAD. Some might not understand why. Here it is--if you are on a hard surface, the sound of your mag hitting the floor is a signal that you are run dry. If you MUST drop the mag, try snapping your wrist sideways as you hit the release. This will fling the mag AWAY from you.
Now, GET THAT RELOAD IN FAST! And, how is this accomplished? Practice, again and again. Practice your mag changes in steps:
a. Acquire reload, oriented properly.
b. Drop empty mag.
c. Insert reload smartly.
d. If needed, retract slide briskly and let it run home. Don't ride the slide!!!
e. Re-engage.
Practice slowly, first looking at what you are doing, then looking at your target during the mag change. Proficiency will come; concentrate on SMOOTHNESS, not speed. Smooth equals fast--and remember it takes an average of 3000 repetitions to "engrave" the muscle memory.
I believe that if you carry a gun, you should practice your reloads--WITH A PROPERLY CLEARED WEAPON, EMPTY MAGAZINES AND FACING A SAFE BACKSTOP--daily, if possible. You can also use weighted mags if you can get them--or make up a mag of dummy rounds if you can't. I would (in that case) mark the magazine full of dummies, and use it ONLY for training--that way if you ever actually have to draw and shoot, you don't get the click, instead of the boom.