I think if you're not over-specialized that you can still do well. Doing be a person who just writes device drivers, or just does web stuff, or just writes toolchains. Do it all, and at depth when you can.
I tend to get into projects that are 2-3 years in scope and involve actually shipping new technologies at consumer scale. This will teach you all kinds of interesting things, from fundamental product underpinnings to making devices manufacturable.
Keep coding, that's for sure. It's not a young person's game if you keep at it. My father in law retired, a firmware engineer, at 75.