While I agree with a lot of the other comments with the "you learn by doing vibe", I feel like it's a bit open ended and it can be a struggle taking the first step.
I started out around 2012 with some "how to do java" tutorials, and through that learned the language agnostic basics of programming (variables, functions, arrays, loops etc). But because I had nothing I wanted to make, I dropped that pretty soon after and didn't touch anything code related for like 5 years.
I randomly applied for a job that required a whole lot of sql knowledge, got the role (when I probably shouldn't have in all honesty) and that prior knowledge helped tremendously in getting up to speed with that, I just had to learn the sql specific stuff on the go.
I then wanted to do a Pokemon Romhack, so followed tutorials on YouTube which taught me a bunch of C and git.
So yeah, it wasn't until I actually needed to use something that I actually learned any languages, and the original language I set out to learn I know absolutely nothing about now, but it did give me the baseline knowledge I needed to pick all the rest up far easier.
After 6 months of medical related delays, today I have session 0 for a Shadowrun 5e campaign that I'm GMing for and excited to start. We have a few newbies to help get up to speed with the system, but I'm ecstatic to finally have another game going after a few years of absolutely none.