I do something similar with a sticky note. I divide it into four quadrants of Eisenhower Matrix and fill in the work appropriately. My goal for the day is to get both important/urgent and less important/urgent (better if I can delegate it) work done for the day and the rest is bonus. https://jamesclear.com/eisenhower-box

While I'm working if something comes to my mind, I used the hotkey for my todo list app and add it to my bullshit box list. This will take some discipline but it's very effective. Sometimes later on I realize the task that I added is not really necessary and was a complete distraction so I delete it.