Hi! I'm having a similar problem - when I'm more depressed, I tend to stick to the internet. I found something very useful when I need to focus/study (still at uni) - it's a freeware tool named Focal Filter.
Into this program you can enter all the webpages you usually visit and spend a long time at (e.g. youtube, pinterest, facebook in my case), and you can set how many minutes/hours you want to block them. Until the set time you won't be able to reach these sites (e.g. if I set that I want to block youtube for 2 hours then I can't visit this site for this amount of time). After the set time you can visit these pages again.
Here's a link to Focal Filter's website, they explain nicely how it is used. I hope it can help a bit.
FocalFilter - Block Distracting Websites