For me, the key was twofold:
1) Spend a lot of extracurricular (not work) time, exploring new tech that interests me. This often included purchasing expensive kit, and attending classes, on my own dime (but I could usually use the spend in my tax write-offs).
2) Be willing to accept being paid a lot less than my peers.
My career is a fairly eclectic one. I’m now retired, and spend a lot of time learning stuff, which is fun.