Look, here's a simple rule. In every interaction with the police, ask if you can leave. If you can, count your lucky stars and leave. If you can't leave, determine if you can get out of the interaction with a ticket or a summons. If you can, work toward that outcome. Regardless, don't tell them your life story. Keep it brief and if they start asking about things that relate to you, exercise your constitutional right to shut up.
Cops are not your friends. Their job is to enforce order. Not to be your best bud.