I study computer science and any time I sit down to code, I just browse or watch Youtube. Anything but do the work. Days and even months have gone by like this where I haven't done even an hour of learning. Its tough because in order to code I need to be in front of a screen but my brain refuses to study and just looks for that dopamine hit. My grades have suffered and I feel like a constant failure.
To clarify this is not an effect of the pandemic but has been happening for the past few years.
Getting myself into a fixed routine, keeping distractions to a minimum, and being offline more (not just when I'm supposed to work) have helped me a ton. I also listen to music through my work to feed me dopamine instead of pulling out my phone, and I've tried to be more 'productive' when I'm not doing stuff, like doing soduku puzzles, doodling, or playing with fidget toys/puzzles in between tasks.
Also since the pandemic started I've been getting up an hour early every morning to watch tv/play games/browse the web before taking a shower and starting my day with a small productive task, and I do something similar before doing my weekend classes