I played computer games as a kid and got interested in computers. I looked at books from the library on how to make games. This was in the 90s and many of the library books were from the 70s or early 80s. Many of them focused on computers like the TRS-80 that I had never heard of. Eventually at the library I found the David Ahl books ("BASIC Computer Games" and "More BASIC Computer Games"), and discovered that I had QBasic available in DOS. I started typing in the listings and playing the games. Pursuing this interest led me to get a fat book called "Using BASIC" that focused on QBasic.
I started learning to modify the games I was inputting, and then to write my own simple games. Somewhere in there I also was learning to write DOS batch files to do simple tasks. I wrote a DOS menu system that let you choose which program you wanted to run, to make it easy for me or my siblings to run any of various games, plus "serious" programs like WordPerfect. My dad got me a subscription to Dr. Dobb's Journal and a magazine called DOS World. They had program listings in assembly that I also typed in and tried to modify, just doing super simple stuff like playing the Twilight Zone theme song on the PC Speaker. A bit later I got into text adventures and wrote a few of those using special-purpose languages. I also wrote some games in ZZT. (And oh yeah, another comment on here reminded me I wrote some silly "games" in the variant of basic on my TI calculator, stuff like a Mad Libs generator.)
At some point in high school I started using Python. I think it was Python 2.1. By that point the internet had gotten to the point where I could learn a lot by searching for stuff, and so then I kind of shifted into using web tutorials and newsgroups and forums and stuff, which continued until today. Along the way I played around with a few other languages, like Haskell, and got reasonably conversant with JavaScript, but Python remains "the" language for me.
So I was self-taught, at first relying on books and later on whatever I could scrounge from the internet. I've never taken an actual class in programming or computer science.
Games were a major factor in my early programming development, the other main line being small DOS utilities. The David Ahl books were foundational for me, and I really hope people starting out today can find something like that, something that makes them go "Wow, look at all the things that I can actually do just by taking this code that I don't understand and learning how to mess with it." The "Using BASIC" book was similarly key in that it got me to understand how a programming language had a syntax, data types, and so on. Even when I moved away from BASIC, I pretty easily understood how when I was reading a tutorial on Haskell or Python, it was in some sense telling me the same stuff that that book was telling me, although the languages were quite different.
Since then I've taught programming a few times and I'm very informed by that early experience, basically the idea that learning to program involves just jumping in and wrestling with stuff, exploring and experimenting.