In my first training course as an LEO, an instructor taught us, there is someone out there every day who wants to kill you. The reason you are both alive at the end of your shift is that you did not encounter that guy today. Watch for the signs. Be prepared.
When you make a stop or respond to a complaint, you have no idea who you are going to be dealing with. You look for the signs. Furtive gestures and movement. Belligerent behavior. Refusal to follow instructions. Refusal to show hands. Being an a$$hole. All of those are danger signs that are guaranteed to peg the officer's pucker factor and cause an adrenaline rush. The officer will shift modes at that point. This will not end well.
Most such encounters do not end in violence, but some do. Some end up in arrests that might have just been a citation or warning. The term we used for that was, he arrested himself. Basic human courtesy goes a long way toward an officer's decision making.
Officers who encounter enough Adam Henrys over time will develop a hard varnish. Never do or say anything that is a sign, that places the officer in fear.
Some officers become cynical about dealing with people over time. It is incumbent on leadership to insure the agency does not devolve into "them against us" or "they are all Adam Henrys" through training and discipline. Body cameras more often than not bear out that officers were not guilty of misconduct, but also provide a great training tool for correcting inappropriate officer behavior.