Roofers, landscapers, construction workers, garbage collectors, truck drivers and farmers are all in much more dangerous and essential occupations than those choosing to be police officers. Police officers just complain the loudest.
Police officers cause much more death in the population than they are subjected to "in the line of duty". They are net aggressors.
https://usafacts.org/articles/how-many-police-officers-die-in-the-line-of-duty/