If you ran out of energy for a big task, are there still smaller tasks that require less energy you could do?
Some low-energy and uncoupled tasks are probably always available: accounting, inbox zero, file organisation, scheduling, daily review, weekly review, self-analysis questions, etc. Unless a YouTube video was on your task list, then it is distraction working against you, not for you.
Otherwise, have you developed an incantation (a ritualistic practice of auto-suggestion) to get the energy you need?
Some practices can be a quick walk outside without your phone, a journal entry on what could be your psychological blockers, a journal entry on finding higher meaning in your work, a prayer, etc.