I don't recommend a career in programming, but if you want to do it, make sure that your skills are in a language that is desirable, and try to keep your skills current. If you are stuck in something ancient that people are abandoning, you might find yourself stuck in an undesirable low paying job that you can't get out of because there are no other jobs available. Unfortunately, your skill at programming doesn't count for much when looking for a job, and it might not necessarily be rewarded on the job either. (Though as others have said, it might matter after you get the job if you want to keep your job, although that depends on where you work.)
At one point in time, a company would interview you and say something to the effect of "Well, you never programmed in X, but you programmed in Y and that is somewhat similar, so you shouldn't have any problem learning it." Now, they'll say, "Sorry, we need someone who knows X, Y, Z, and A, B, C, and if you don't have those skills, we will get someone else who does."
The difference is that now there is a lot more competition for jobs, and a lot of it is from India, where programmers might work for 1/10 of the salary that you need here to survive. With all of the talk about tariffs, no one is talking about putting tariffs on services like programming, only physical goods made overseas and shipped here.