The safest layover decision starts with your real usable time, not the number printed on the itinerary. A five-hour layover is not five free hours. It is arrival, taxiing, deplaning, walking, transit, the activity, the return trip, security, and boarding.
Use the buffer stack
Start with your layover length, then subtract time to exit the aircraft, time to reach transportation, round-trip transit, airport security, and a boarding cushion. What remains is your actual exploring window.
Pick one thing
The best city layovers are focused. Choose one neighborhood, one meal, one museum, one scenic walk, or one errand. A layover is not the moment for a multi-stop itinerary.
When in doubt, stay near
If the math feels tight, pick something close to the airport. You still get a reset without betting your onward flight on perfect traffic and short security lines.