If you've ever played Darkest Dungeon, that's pretty much how game jams go. The same strategies apply.
Anyway a more useful tip:
Personally I think my best tip is to just be sure to eat. My first game jam I didn't either eat or sleep. You need to do one of those to stay awake. It's better to sleep on purpose with an alarm and get back up than to fall asleep on the spot or let your brain get to a non-functional state. Just getting some food, especially if you can walk there to pick it up, will really help keep your brain working while you hammer out code for your overly ambitious project (not a slight, I just don't think there's ever been such a thing as a properly-scaled game jam game). If you have to pick one, I would say choose food over sleep. Both keep your brain working, but you can eat while you work, or take a food break with your team to discuss next moves, where everyone's progress is, and what features might still need cutting. Taking a break to discuss with your team helps keep everyone's productivity up and results in better cohesion in the actual game, so if you can do that while walking down to a nearby pizza place or corner store, that'll get everyone awake and with enough blood sugar to power through the crunch period at the end.
Yes, you could just grab a snack bar, yes you could get a pizza delivered, yes you could eat it while working, but I highly recommend using this as a team meeting, and, time allowing, walk to pick up the food to get everyone's blood pumping. Think of it as a sort of 'party buff'.