I have preached over the years that if you encounter a law enforcement officer then you need to keep your mouth shut. As a former law enforcement officer, I was trained to use very deceptive techniques to elicit responses from the public that could be used to either issue a citation, search them, or to arrest them. When it comes to conversations with cops, less is best!
Here is a very good informational video from Jeff Hampton of The Hampton Law Firm. In the video, Jeff goes into detail and points out a lot of the ways law enforcers try to get people to talk when those people should remain silent. Take a moment and listen to what he says, learn from him, and then KEEP YOUR MOUTH SHUT!
And one more thing: ALWAYS RECORD THE POLICE!