It's a conscious decision that you have to make. It helps that you recognize the problem and now all you have to do is take the next step which is do want you want to do so that you don't keep wasting anytime and continually feel regret.
Now you have to prioritize. You can make a list or use an agenda planner. Have a schedule. This is a dumb made up example: so you got up and immediately went to the computer and stayed there for hours browsing, or decided to play a game or whatever
You go: I'm going to get up, brush my teeth, cook and wash those dishes, tidy up, etc, etc. and THEN I will take time to study. Or I'm going to do this for 2 hours and then that for an 1 hour and I'm sure you get it by now.
If anything you can disconnect the console or the internet. What happens when the power goes out? You go do other things, right? Probably stuff you put off for a while. Don't connect it until you have done whatever it needs to be done and later you can "reward" yourself with some relaxing, fun time well deserved.