If the layover for the flight is less than 2 hours then it would be best to just stay around the airport instead of leaving the airport and risking missing your flight when the flight does take off.
If the flight is laid over until the next day then if possible it's best to leave the airport and get a hotel room until the next morning when your flight takes off.