Just so we’re clear are you talking about literally falling asleep? If that’s the case you probably have narcolepsy.
If it’s a matter of your brain staying active enough to be able to engage, without getting frozen, a few things:
Limit morning caffeine. It’s an upper, and uppers crash down. The down part isn’t so useful for being alert
Limit the size of lunch
Avoid inflammatory foods at lunch
Get a little exercise
Use pomodoro timer to ensure you take a break before you need one
Hydrate well
On that last point: breaks are like pain meds: you should take one before the need for one becomes apparent. Keeping to that strict 25-5 schedule is great for keeping me close to peak in terms of my ability to do cognitive work.
For insomnia, the best thing for me is a 5-minute meditation session using a Muse 2 device (consumer neurofeedback training device, about $250 on Amazon). If I’m having recurring insomnia, a 5-minute session on the muse gives me about two weeks of insomnia relief.
Mostly though, I do indeed avoid desk jobs in favor of jobs that have at least some physical activity. My current job is about half desk, half physical work. And lots of face to face interaction too. Interacting with others keeps me energized.
I came in to work one Saturday. My first time in the office on an off day. Just figured I’d get a little work done.
Computer wouldn’t let me log in. Being smart, I recognized the early signs of being fired and decided I’d get ahead of it. I couldn’t get fired again. It would just destroy my career.
So I resigned. On Monday there was so much confusion. Management was so confused, they were like “we thought it was going well”. I had some cover story about why I was quitting, because I didn’t want to admit I was just trying to interrupt a firing with my own resignation sorcery.
Finally I realized the pained looks on their faces were real. Luckily, I was finally honest about what my reasons were. Turns out IT was doing some work on my computer, and had temporarily disabled my account. Or something like that.
Anyway it just about the most ridiculous comedy of errors I’ve been in. I feel so bad for my employers. They were like “But what?? We thought it was going great”.
After discovering I had thought I might be on the verge of being let go, they resolved to be more clear about how much they valued me.
Chemical based hand warmers. They look like tough-built teabags. Get them at any Home Depot or Lowes.
Also McDonalds cheeseburgers are nice. Where I’m at, they’re buy one, get one for $1. I can get 4 of them for $8. When I was homeless, I was calorically restricted and it sucked so much. One day there was a guy handing out McDonalds cheeseburgers from a big bag, and it was the best thing.