You may want to investigate if there is a deeper reason behind your avoidance for studying. For example, uncertainty around "is this stuff actually useful" or "will I succeed" may create anxiety and avoidance and push you towards distractions, whatever they may be. You could then work on accepting or eliminating that uncertainty.
On the other hand, maybe it's much simpler and you're just addicted to some of the junk you find online, similar to how some people are addicted to porn.
When starting to randomly browsing, you're looking for quick dopamine, and you need to train your brain to start liking more difficult ways of acquiring it.
If it's a problem with discipline then you need to figure out a strategy to improve your discipline. Pomodoro timers could help, or being mindful of distractions and minimising them. Read Atomic Habits and Deep Work if you want to dive more deeply into the nuts and bolts of this.
Motivation is deeper. If you don't understand what you truly want, and align yourself to that, you'll be constantly fighting yourself. Why do you think you should be studying? Is it because you genuinely want to learn more about a subject? Or do you just think you should be studying because that's what a productive person would do? Maybe spend some time journalling about this to try and wind back why you want to do this and why you think you aren't doing it.
Or maybe you just have ADHD. /s.
Work on something that delights you, and improves your value. For me that's coding (again...finally!).
If you can't work on whatever is most important, at least waste your time in the right direction and level up.
Just be aware of yourself, that's my best advice. If you want to do the work, you'll figure it out. There's no trick except maybe to make yourself want it.