Is this a new thing for the kid? If yes, then I'd try to figure out what caused it, eg. did they move to a new city, did s/he get rejected from college, bullied at school, rejected by a boy/girl, maybe s/he is gay, etc.

Apart from talking to them as suggested by others in the thread, I'd try to channel it. Thing is, spending 8+ hours a day in front of the computer isn't really a big deal these days. Most people with high-paying jobs spend 8+ hours a day in front of the computer, plus another 2-4 hours on their mobile. (Myself included.) The trick is to make it productive. Are you sure they are just playing games and watching stuff? Are they not messing around with Linux or gcc or Visual Studio or Unreal Engine or Photoshop or whatever?

So, what I'd do is, take them to the bookstore, go to the computer section, and buy them a bunch of books. C, C++, Javascript, cool stuff like Unreal Engine, plus whatever they want. If they don't want to go, just go and buy it, and put it in their room. Show them GPT-3 on OpenAI. Give them an AWS account. I don't know if it'd work, but it's worth $1000 to try it. If the kid can channel it into productive computing (programming, design, whatever), then this "addiction" is actually a huge gift, as they will be set for life.

I would NOT try to lock the computer away, esp. at this age. That's like burning bridges between the parent and the kid. That's essentially treating the kid as an idiot who needs to be forced to do "the right thing". Thing is, the parent's intuition about this time being wasted may be wrong, but in any case that is not a good approach. It will just lead to the kid hating the parents, probably for life.

Somewhat unrelated, 18 is a great age to get a job. I think most people/kids, once they figure out that a job comes with a paycheck, actually love to have a job. So, if they're not going away for college, try to help them get a part-time job, maybe like 4-hours a day as a start. I suspect after the first paycheck the kid will love it, and will want to make more money so s/he can move out and get rid of the parents..

-

Personal context:

tldr = spending a lot of time on the computer from an early age has resulted in far more positives than negatives for me, and has not impacted my life in a major negative way overall. If I could go back in time, in general I would not stop myself from spending so much time on the computer.

I'm 41 now, but I spent a lot of time on the computer from age 7, probably 2-4-8 hours a day, depending on age. For me, it's always been like that, we had a Commodore-64 at home when I was 7 years old. I would play Pitstop [1] on it and type things into the BASIC interpreter.

When I was a teenager, my parents were concerned about my computer time ("he should be out playing sports"), and they locked the computer (and TV) in various ways. Back then computer cases had a lock on them (with a key), so they did that, but that was easy to circumvent. So then they put a password on the BIOS, that sucked. Fortunately they used weak passwords so some of the times I was able to guess it. Locking away the computer when I was a teen was a (one of the many) spectacularly bad moves on my parents part, and was one of the reaons I barely talk to them.

Thing is, I also played a lot of games, but I also spent all that time learning and understanding computers (I must have re-installed Windows and recompiled the Linux kernel 100s of times), pirating everything I could pirate (including books, which led to my life-long habit of reading and self-improvement) and trying it out, teaching myself programming (BASIC, then Pascal, then C/C++, etc) and that turned me into the person that I am today.

All that time on the computer did not keep me from later becoming very active in sports (I've been doing triathlons since 2008, from sprint to Ironman distance, 38 races so far), I go to the gym 5-6 times a week, I average around 90 mins a day working out in some form. To be fair, in part to counter my time on the computer, my parents forced me to do various sports during my teenage years, althoughI resisted and sabotaged these efforts. But, again to be fair, the reason I can do the swim portion of the triahtlons easily is because they forced me to play water polo for a couple of years.

I also became a car guy 5-6 years ago, so now I drive a Porsche 911, which I can afford because I have a high-paying job, which I have because there's very few things I can't do/accomplish/figure out on a computer, which is because I've been on it for ~35 years. For example, I manage a Data Science team/org now, but I still regularly help out when some sort of Java exception comes from deep in the stack or one of our ML endpoints goes down because there's some Linux issue on one of our EC2s; for me it's trivial because it's probably something I encountered when I was 17 and was messing around, for many others it's a hard-blocker.

I still spend much/most of my time in front of a screen, because it's my job and even outside my job it's the default thing to do if I'm not (i) spending time with my family/kids (ii) working out/doing sports or (iii) driving around.

Having said all this, I do think I missed out on a couple of things. I had my first girlfriend when I was 20, which is about 4-5 years too late, that sucks. I've never been very good with girls, which led me to have limited selection, which possibly led me to get married to the wrong person the first time around.

The second thing, a bit related to this topic is, my parents, being from E-Europe, thought that kids should not get a job and should focus on their studies. So although I had silly / not-very-serious jobs since 16, the first real job I got was at 23 when I graduated. That is another miss, I've always felt I'm ~5 years behind in terms of life-maturity.

[1] https://www.c64-wiki.com/wiki/Pitstop