I've done quite a few, and remember fondly a double all nighter my first startup pulled to release 1.0. Sometimes it makes sense, but it is better to be avoided.
-Feed yourself well. Avoid sugar. Drink water. -Marvel at the sun, people in their rituals, etc. -Make a simple agenda: when to leave work, when to eat, etc. -Take a nice shower, dress comfortably. -Put on music and get into a groove. -Don't make any critical decisions. -Defer tough conversations. -Plan "re-entry" with enough sleep to land on a normal schedule. (ex: 12 hours of sleep ending at 7:00am.)