Back at my first job, I'd just go to work, go home, stay up all night working on stuff, go back to work. Lived with cats im severely allergic to, for one year had immunotherapy and became immune, then the next 3 years after quitting that were miserable as it came back full force where you go to asleep wondering if you'll wake up or suffocate. BUT I'd go buy epinepherine (adrenaline) to go inhale if needed for breathing (one day had to take a 5 minute breathing brake just from backing a car out of the garage at work), would take nyquil every morning to coutneract severe allergies (being tired was way better than being all gross and sneezy n shit), then a monster to counteract the nyquil when that became a daily thing but you can generally power through the tiredness of the nyquil and once you get over a period of time you stop feeling tired and remain allergy symptom free (nyquil is the only thing i knew of that worked, no time to risk trying something else and it doesnt work).
2nd job, working 80+ hours a week, irregular hours so hard to coordinate sleep, plus workaholic so id stay up all night after work on my own stuff lol. Then go work two 14-18 hour days back to back where you'd stay overnight in a hotel, but have a leave time that's 3 hours from your arrival. I was the only driver for the company, so the 6 hours a day of driving that everyone else got to sleep, i didn't (and i thought i got paid more for it lolololol). Worse, had to drive everyone around during lunch breaks, which were mandatory, can't just keep working gotta waste everyone's time/money just sitting there, or if you're the driver like me, drivign everyone around, can't use that half hour for sleep. Would piss me off when people pile in the van and not a single person actually gets food, they all just wanted to ride along with to the food places. So much sleep deprivation that I'd regularly swerve over the lines at least 5 times a day, about just as many microsleeps (brain forcing sleep) behind the wheel a day. A few times you'd go completely over the line and jsut by luck the passenger is awake too and is like wake up lol. Would drink so many energy drinks, one particularly bad day I had 4 Rip-Its, and 5 energy shots, still fell asleep on the drive home. Got pretty good at driving asleep tho, no accidents, but you'd do things like be going 70, coming up on a 55mph semi, and not see the semi or think you gotta switch lanes til about 10 feet form the semi lol. Quit that job, company was waaay to screwed up, and wasn't about to die to count tshirts at some random store.
3rd job, had a regular schedule n job, hated the job and the boss (with a passion) so made it through the day by suffering through the job til a point in my life where i was ready to quit.
4th (current) job, weirdest job ive ever had, not sure i'd call it a job. Night shift basically sit here, do some paperwork that i've automated with a program i wrote, 8 hours ngihtly, just work on my own projects, watch netflix, sleep, whatever u wanna do, just make sure i check on people once every half hour. AND more pay than any of my other jobs, and far less hours or work for it. Still, bad decisions with sleep (plus I drive 4 hours a day between work and home, so less free time), and I try to avoid sleeping at work, so I acutally bring a monster or two and drink it if im struggling to stay awake. Currently trying to get on a good schedule/routine and not have to drink mosnters, because it's all bad for you, I don't even like drinking caffine lol.
Used to be in the national guard. During annual training they'd do traning exercises sometimes where you'd not sleep all night, once where they secretly decided we all keep going until a driver falls asleep in one of their vehicles (happened in a one man vehicle lol). How'd I keep going with that? Pretended I was awake, Don't committ to full on sleeping, don't committ to staying awake either. Look through the night vision scope, rest your head on the buttstock, rest the gun in a supported firing position, any time you wake up, switch directions you're looking a bit. Give the impression you're thoroughly scanning the fields for them bad guys.
Also at my first job, I'd hear people tell stories, one guy told a story of how in his old days he used to drive semis full of coke across the country, and he'd use it too to stay awake for dayyyyz lol. So that's always an option. Not a smart one, but an option xD
Overall though, what keeps me going, is knowing im screwed if I fall asleep n get fired or something. And just wanting to get things done if it's extra stuff I do. Too bad I can't focus all my work to be efficiently productive. My biggest issue, is i got a girlfriend, which is a major hamper on productivity and efficiency in life, yet, I got issues and a codependency, so she is also how I productivity. Historically, I've had days I was unable to get out of bed at all or do anything, just lay there til i was able to sleep again and not be awake. Then you get a girlfriend and bam, productivity and completely forget you got crippling life-issues/problems until you're single again and the world falls apart again til further notice.