No one's job is safe in the 21st century. Here's how to stay ahead of the curve

Robot in office
John Lund | Getty Images

These are nervous times for American workers, facing the dual threats of globalization and automation. Many believe it's only a matter of time before their jobs are either shipped overseas or handed over to a robot. The first wave of victims has largely been blue-collar workers without degrees (e.g., manufacturing/factory jobs now performed by robots or offshored) and low-wage earners (e.g., McDonald's replacing order-takers with self-serve kiosks).

For those in knowledge-based professions, the monster may not be knocking on the door today, but it would be foolhardy for them to feel smug that their jobs are "safe." The truth is no one's job is safe in the 21st century's industrial revolution. Yes, that even includes IT workers.

Not only is the workplace changing significantly and rapidly, we've also got a new administration in power. In Mr. Trump's first joint address to Congress, he touted his commitment to "bringing back" manufacturing jobs across the U.S. with companies like Ford, Fiat-Chrysler, General Motors and others.

I'm one of many who express doubt that anyone can really revive factory work, given that the bulk of these jobs have been replaced by automation, not globalization. We can't uninvent technology. The plain fact is productivity has soared as automation has expanded, and companies aren't about to forfeit those gains in service of an election promise.

For instance, after Trump announced a decision by Carrier not to move one of its facilities to Mexico, the CEO of United Technologies, Carrier's parent company, acknowledged that most investment in this plant will actually be for automation. A few hundred jobs are "saved" for now, but the writing's still on the wall: The majority of lost manufacturing jobs no longer exist—and not just in the U.S. but also in China.

So, even if we can squeeze a few more years out of traditional manufacturing jobs, it won't halt the rise of the robots indefinitely. We're all still facing the challenge of staying relevant and employable in a rapidly changing world.

The reality is, no one's job is safe. But here's how we can help people prepare for the future.

Revamping our education system is one way. Kids need more and earlier instruction in STEM subjects and, as they get older, more vocational training that puts them on a path to real jobs. Our colleges and universities could do more to prepare graduates to succeed as professionals with the skills that employers now demand.

But that's not enough. To stay relevant over the course of an entire career, we all need to keep learning and reskilling far past our graduation dates. Some of that might come on the job from our employers, and some of it might be available through government programs, but the only resource you can be sure isn't going anywhere will be your own self-motivation and ambition.

Of course, maintaining hard skills is critical. Programmers should keep up with the newest languages and software frameworks, while marketers and advertisers should gain basic understandings of analytics to keep up with the data-driven transformation. No harm in picking up some basic web coding skills either.

But regardless of profession, it's really the soft skills that will elevate us above the automation--the places where humans excel and algorithms can't duplicate. These include skills like problem solving, building relationships, and effective communication, as well as developing strengths around creativity, innovation, and emotional intelligence.

Lifelong learners have always been among us, but now they're finally being held out as the most valuable and viable employees in the job market. They're the ones who have the innate curiosity and drive to seek out new knowledge and skills, whether they're immediately applicable or not. This puts them in a prime position to respond when job requirements do change.

Eager learners are also unlikely to resist the call to upskill and find it unpleasant or scary. Instead, they embrace such a challenge and consider it just one step in their lifelong journey to grow and improve.

If that doesn't describe you, the good news is that you can change your mindset and become the kind of lifelong learner companies are scrambling to hire. And, with so many self-paced online learning options out there, you don't have to enroll in a full-time program, relocate, adjust your schedule, or pay a high tuition. But you do need to take action.

Sitting and waiting for the dust to settle isn't the right strategy, whether you're in an industry ripe for automation or not (yet). Be proactive about upskilling now. And then keep on doing it tomorrow, and the next day, and into the future.

Commentary by Dennis Yang, CEO of Udemy, Inc., a global online marketplace for learning and teaching that's empowering millions of students to master new skills and achieve their goals. Dennis is a regular speaker at top industry events, such as the Fortune Global Forum and Global Education and Skills Forum, and is featured frequently in media outlets, including Bloomberg Business, the Wall Street Journal, and Fortune. He received his MBA from Stanford University and BS from Northwestern University. Follow him on Twitter @dennistyang.

For more insight from CNBC contributors, follow @CNBCOpinion on Twitter.