We called this "brass over bolt" or "fatal jam". The first thing we did is draw the handgun and stay in the fight, but look for a protected place to clear the malfunction. As he said, it is usually when the ejection port is right against an obstacle like a wall, or the ground when firing from "rollover prone" or "brokeback prone". When firing from one of these prone positions, we would place the fist of the non-firing hand between the handguard and the ground, if against a wall, inverted c clamp grip on the underside of the handguard to get the thumb between the handguard and wall. Doing these things creates a space for the expended brass to (hopefully) clear the weapon.