I have a 9-year-old, and he's pretty much into his "iPad time" where he gets 30 minutes per day. He's got a soccer team which demands a certain amount of time per week, but like most kids he has a lot of free time...

We did two main things:

1) From the age of about 7, we started him on something called "Beast Academy", which is basically a maths course for kids, using examples in a cartoon-like style. He did simultaneous linear equations a month or so back, and I'm pretty sure we didn't do that until I was 11 or so...

He's pretty competitive, so harnessing that and treating it like a competition or puzzle that he could solve was the best way to get him to accept a daily dose of maths, say 2-3 pages of questions in the books. That's not to say there haven't been times when we say "Beast Academy first, iPad after". He is a kid after all...

What we don't do is treat it like schoolwork. We draw the distinction between the two - this stuff is more advanced than his school is teaching, and he understands that doing it now makes it easier in school, which is a win - but treating it as a "joint exploration" thing where we talk about the concepts ahead of time, and then he tries out the questions, then we go over them without worrying about which ones he got right or wrong lets him see the difference between this and school too. It became more like puzzles and fun because we worked at making it more like puzzles and fun.

2) Every two weeks or so we get one of {Makeblock kit[1], AdaBox[2] or Kiwikit[3]}; he got 3 of the large technical lego sets (the 3-4000 block ones) for Xmas; he's seen me programming stuff before (Saltwater fishtank controller, most recently radio telescope software) and he likes building stuff and coding stuff - the kits above (apart from Adabox) often have a guide of what to do to get started then leave it to the imagination, and it's actually interesting to see where he takes them. I'm fairly certain he gets a kick out of the weekly show-what-I-built to grandparents over FaceTime as well.

I also include him in my "building stuff" projects. When I wanted a better solution for hanging the lights off the ceiling over the fishtanks [4], we both sat down, I sketched, I asked him questions and whenever he came up with an idea that I thought would work well, or even if he came up with the same idea I'd already had, I'd say "ok, let's go with that", sparking interest and involvement. Even at age 9, you want some ownership of what's happening :)

When he was 6, actually for his birthday party, I made a lego-boats raceway [5], and since it was for him he gave a lot of input (and wanted to help make it so it was "perfect"). I don't give 6-year-olds power tools but letting him decide where the obstacles ought to go, then doing a test-run, and talking about why the placement matters and letting him change his mind to have something "better" to show his friends was a lot of fun for him, and he got a kick out of talking about why it was better in the current configuration when people came to the party.

We do other things, but the common thread is involvement and ownership, and that also comes with consequence. I'm (generally) fine with him making mistakes and not fixing them myself (unless it's really crucial, I'm not going to let him hurt himself). He gets to understand consequences that way, and (slowly :) learnt that it's better not to always insist on his own way.

At the end of the day, I'm just trying to make him use that brain of his for more than watching videos, and the best way I know of is to make it fun to do. Coincidentally, that makes it fun for me too :) The results manifest in often-unlooked for ways: when we were watching a Saturday night movie he'd chosen (we rotate choice) and after a giant 60' tall baboon-like creature had jumped up an improbably large distance, he turned to me and said "that wasn't right - he's strong because he's big but he's really heavy too". There's looking, and there's seeing. I'm trying to teach him to see by learning to do.

[1] https://www.makeblock.com

[2] https://www.adafruit.com/adabox

[3] https://www.kiwico.com

[4] https://i.imgur.com/46jq2XM.jpg

[5] http://lego-boats.oobergeek.net