Do not draw unwanted attention to yourself.
It is best to go unnoticed. Do not act brash, loud or obnoxious. Be polite. Be unmemorable.
Good people who go unnoticed are far less likely to get in trouble - or to attract trouble.
Do your best to avoid “hot spots", i.e. bars late at night and political rallies or types of confrontations - places where people tend to become jackwagons (idiots, butt-heads, take your pick).
The best way to stay out of trouble, is to not go near it in the first place.