Active shooter scenario

I know the OG has a ton of gun owners so here's my question:

If someone is able to wrestle away a handgun/AR/shutgun/etc from a burglar/shooter but then the shooter presents a knife as a secondary weapon. What would the person need to do before making sure the weapon will fire? I'm aware of the safety but is there an easy way to locate it for someone who doesn't without gun experience?

Assuming the safeties are engaged. Phone Post 3.0

Run Phone Post 3.0

If it's a shotgun just rack it and the assailant will fall dead of massive heart failure with a massive load in their pants.

You need to be more specific on the type of gun. 

Handguns can have safeties on the slide, the frame, the grip, the trigger, etc. 

Rifles can have safeties on the bolt, the frame, the trigger guard, etc. 

Shotguns can have safeties on the trigger guard, the tang, the frame, etc. 

Instead of asking on a forum where one cant physically show you, maybe sign up for a firearm class, have a friend take you shooting, look into firearm training.