I was instructed by my father very early on that there were two kinds of people to never argue with, judges and police officers. Not to kowtow but to just treat with respect. As a successful moonshine man he managed to never end up in jail following that code. So I’ve always counted it as sound advice and been well treated in return.
It is amazing how a philosophy of “don’t be a dick” can get you not just with cops but in life in general.