For every long rest, you get a limited number of spell slots - for example at level 5 you get 4 level 1 spell slots, 3 level 2 spell slots, and 2 level 3 spell slots. These are all the "major" spells you can cast before you need to long rest again.
Some things may be more straightforward, and only take a level 1 spell slot. But it's still possible to run out of those. Luckily, you're able to use a higher level spell slot to cast that same spell. Sometimes this makes the "spell" more effective (using a higher level spell slot for programming might relate to intentionally putting more focus on it), other times you're just burning the higher leveled slot.
Other actions/spells may take more focus/concentration/energy/effort to do, akin to using a higher leveled spell slot. Naturally you can't do as many of those without resting.
Still other actions/spells are trivial for you to do. You can do those as many times as you'd like, and you don't feel (significantly) affected by them. These are your cantrips - the simplest spells, that can still be very useful.
I like this variation of the theory not just for the gaming flavor, but also because it changes the concept slightly from "this takes more spoons than that" to differently sized spoons, which feels more in line with how I relate to the tasks that give me trouble.