I think the best way to have a long career in tech is by expanding your knowledge, don't focus on only one area (like Frontend or Backend), but try to learn new things every day.
For example, you can try studying Blockchain, I'll share this article if you want to start: https://www.ratherlabs.com/post/the-roadmap-to-become-a-bloc...
And this article to stay ahead of the curve: https://bootcamp.berkeley.edu/blog/most-in-demand-programmin...
Good luck!