Do some planning or prioritizing - because you probably don't do enough of these, and they're usually a quick & excellent use of time. E.g.:
See also https://www.lesswrong.com/tag/five-minute-timers
Pomodoro is the phrase that immediately springs to mind.
A previous LessWrong post on someone's use of this technique.
A few things that can help (which I do sometimes, but sometimes do just "waste" the interstitial periods).
"Keep multiple task lists by granularity, or keep entries on your task list that can be done (or worked on) in short time periods with low cost to switch in or out of."
This seems like it will take more time than its worth in the context of the question.
N.B. I'm terrible at this so far, but I also run into this problem frequently, and my best idea is to keep an ~evergreen list of "things I can do quickly that are useful".
E.g. short bit of exercise/stretching/yoga, quick walk, read 10 pages of a book, make a healthy meal, deal with a couple of tedious admin-type emails, etc. I don't think most "real work" tasks fit into blocks that short for me (they may for some personality types/types of work), but there certainly are other useful things to do with that time.
Here's a common situation I find myself in: it's 1:30pm and I have a commitment at 2pm. I'd like to spend the next 30 minutes working, but all of the tasks I need to complete will take much more than 30 minutes to complete. I think to myself: "By the time I get set up to do this task (context switching etc), it will be basically time for my 2pm meeting, so I'll have mostly wasted the last 30 minutes."
My primary fix for this is reserving contiguous blocks in my schedule for deep work. However, I do not always have control over my schedule.
What are tips for effectively using short (<30min) blocks of time?
(Feel free to redefine "short" if you perceive "short" in a different way.)