You shouldn't try to stay awake in most cases. You'll work more efficiently if you get regularly sleep. As others mentioned, you'll end up losing time doing nothing by trying to stay awake. Nonetheless, there are situations that require you to stay awake. These are typically deadlines, but sleep deprivation can increase mood and put you in an interesting state of mind. If you're a writing creating a scene where the characters are sleep deprived, you might purposefully put yourself in that situation. Or you might have a creative tasks that can benefit from enhanced creativity via sleep deprivation.
If you need to stay up, there are too many options to list. Medically, medications like adderall and modafinil can help. You might have a sleep quality issue and need medication or something. You never know. Caffeine is available for everyone, of course. Some people aren't aware of the fact that gradually sipping caffeine is more effective at keeping you awake than quick consumption.
Music can help, leaving the lights on can help. Basically, simulating the day-time can trick your body. There are light therapy lights you can abuse that might boost your focus in the evening. These are available over the counter at a pharmacy. Taking a shower, preferably cold, doing some exercise, having a snack, drinking a lot of fluids. If you're like me, having to go the bathroom somehow keeps you alert. It's annoying when you are cozy in bed and want to sleep. Apply mass liquid consumption to your staying awake efforts. Caffeine will obviously help, but it's important to get water in your system, too.
Naps can be effective for some people, though I only take them "very rarely" and almost never late at night. Then you've got fans and air conditioners. Wearing daytime clothing. Setting goals for yourself to stay motivate. Keep alarms and timers scheduled to go off periodically.
I spent my first year of college staying up all night at least once every two weeks. My subconscious knows better than that now, and I rarely do that anymore. It's just not worth it. The last time I did that was because I had an early flight and I would've barely got any sleep as it is. Plus my medications allow me to stay up fairly easily if I really need to do so.