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.
That's normal for trying to create new habits. Just keep trying, remind yourself that it works when you do it (the opposite of the little voice inside your head that tells you that you suck when you mess up), and when you (inevitably) mess up, forgive yourself and get back on track.