It's a conditioned response caused by reinforcement of neurological pathways in your brain. The more you do an activity, the more you have a tendency to do that activity in that way. For example, someone who always buys the same things at the grocery store will go on autopilot while shopping, in your case it's because every time you try to study, you immediately switch away from your task, so your brain has developed this mental pathway caused by always doing this behaviour.
If I may make a suggestion, try breaking your routine and doing things in a different way than you usually do. This will make it easier to do things differently because since it is a new stimulus your brain doesn't already have a conditioned response ready.
For example, bring your books with you and study somewhere else than you usually do like a library. Wearing different clothes, (in the case of lazy NEETS, being fully clothed), or doing your work in a different room of the house than you usually do are also good methods. I also found that waking up early in the morning helped me break my old habits and lazy routines.
The key here is that things have to be different than what you are used to, and you have to force your brain to associate this new stimulus with being productive. It's gotten to the point that for me, I subconsciously associate getting dressed in formal or semi-formal clothing with getting work done, and wearing shitty track pants with being lazy.