Obsessions, addiction, etc. should never be dealt with "negatively".
As in, you should never see it as "I should remove this bad habit". For most people, that bad habit is all you have. What are you gonna do, stare at walls all day?
The way to fix it is positively.
Add things to your life, instead of removing. Pick up a workout routine. Get some meditation in. Read something useful. Do something with your friends, or make friends if you don't have any. Make some money on the side. etc. etc.
As you gain new things to do and new interests, you'll naturally spend less and less time and mental energy on the bad habit.
Yes, this even works with drugs, I've seen therapists advise this. Instead of removing your only dopamine source, add new ones.