Beyond drugs and alcohol, a surprising number of tourists get into trouble over things they never imagined were illegal. Photography of military sites, airports, bridges, government buildings and police causes detentions in quite a few countries, and drones are the fastest-growing problem: many nations require registration or permits, and several ban tourist drones entirely, confiscating them on arrival. Check drone rules before packing one, without exception.
Public behavior laws catch people too. Public displays of affection can bring fines or arrest in conservative countries, swearing or rude gestures are prosecutable in a few places, and disrespecting the monarchy, flag or religion is a criminal offence in several nations, including in social media posts. Some countries penalize jaywalking, littering, chewing gum, feeding pigeons, or eating on public transport with meaningful fines. Dress rules apply in a handful of places, from beachwear away from beaches to modesty requirements at religious sites.
Two quieter traps: exporting antiquities, coral, or certain plants and animal products is criminal in many countries even when bought openly in markets, and vaping is banned in several nations. A single read of your government's travel advisory plus the destination's official tourism site covers most of this in ten minutes, and is genuinely worth the time.