It varies on many factors, but generally before pulling the trigger you have to visually identify a threat, yell a verbal warning, show your weapon as a warning, fire a warning shot, aim at the threat and repeat the verbal warning, then fire if necessary.
Obviously this doesn't apply to full-combat situations, but for instances of the type that our domestic police force encounter, it most certainly would. It's so ingrained that I always wonder how we have so many occurrences of police shootings.
Sad situation, especially because (imho) the vast majority of police are amazing, selfless, community minded heroes, whose profession is besmirched by these brutal thugs who share their uniform.