Try to orient yourself around some kind of purpose.
Without a purpose that moves you, you'll look at your bad habits and dismal prospects and think, "ah, yeah, I should probably do something about that" but to actually get the motivation to change, you need something to shoot for. Something bigger than yourself, or an intense infatuation with a woman out of your league because you're so indolent, etc.
On top of having a purpose, you need to have the agency to achieve that purpose— the view of yourself as being the protagonist in your own life's story.
I have a little trouble with this, as well. I have shit I need to be doing all the time, and no real need to go online, so I tend to stay unplugged for days at a time. When I go on, it's with a specific set of intentions. Today I wanted to get some books about architecture, and a few about computer science. I check my youtube subscriptions and download only the things that I feel will be worth writing to my hardware, then check /late/. Today I happen to have spent about a half hour here, which is about half the time I've been online in total. Now I'm going to hit the reply button, unplug, and sift through the books.
Gotta get shit done or I'll never be able to build my compound innawoods, stargazing onnaroof, free of the noise and filth and general insanity of the city.