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.
This may be a "me probably being on the spectrum" thing, but I've always struggled with this sort of thing a lot, and I've definitely had to develop coping strategies to try and address it.
I think one of the more effective strategies for me has been "playing make believe". For example, I'll get myself to cook by playing "chef". I'll get myself to code by "playing hacker" / "playing engineer".
I also highly recommend this article. I think it has some really good insights, and helps build an awareness that may improve outcomes for you. It definitely resonated with me. https://www.theatlantic.com/business/archive/2014/08/the-procrastination-loop-and-how-to-break-it/379142/
For me, this has been a relatively new thing in my academic life. I've only noticed it happening since my senior year of high school(I'm in senior year of college rn). Before that, I could focus for hours on end without a hitch. The internet I think partially broke my brain once I started to use it heavily. That combined with persisting self worth issues since high school due to getting shit grades even after giving it my all has probably been the root cause of my misery rn.