Hay it's not necessary about not doing anything illegal it's about how you respond when you're confronted by the police... take a statical look at recent "police killings" and notice that in every case resistance when confronted is the defining factor. As for "police killings"of race in 2019 they killed something like 8 African Americans and 19 white people.
when I was young I got thrashed by the police twice and both times I resisted and tried to get away and I'm just glad I didn't try to take one of their weapons.
After the second time I learned my lesson.
Years later I quit being a dick to them and noticed that they would not only let me go from time to time I got off with a warning.
As I aged I don't break laws anymore and whenever I am confronted by police I treat them like humans without attitude and I haven't had a single problem in over 20 years I now live with a clean record and no worries and it's all due to a change in my attitude towards life,authority figures and the police.
I ain't saying that there aren't bad cops out there but to say all are bad is just ignorant and perception of a perceived reality can cause it to come true.