In retrospect, I think the main problem was motivation, in multiple ways. It was during a period of "I don't really know what to do, so maybe I'll try to learn to program, or maybe learn a little Korean, or what if I got into...", where I was exploring broadly, but without clear goals or much practice learning on my own. At the time, I didn't even know what I wanted to major in! Because there wasn't much real interest backing the initial exploration, I backed out when I ran into some resistance and it required a little more effort, and I instead moved on to the next thing (spoiler alert: I also didn't learn Korean). I wasn't very good at putting in the work it takes to learn hard things, and I hadn't had a lot of practice studying, though I somehow passed my freshman year classes without good study skills.
I think that starting with the broad, amorphous goal of "learn to program" didn't include tangible goals that I think would have helped motivate 19-year old me, like building an actual website, writing a useful app, or making a basic game. As another comment says, multiplying numbers for the sake of multiplying numbers wasn’t enough. Coupled with the aversion to putting in the work, I don't think there was enough to motivate me to keep going.
When people ask me about learning to code, I try to think of ways that they can leverage their interests — maybe if you love cooking, you can learn enough to build a very basic cooking app. You'll run into some tough spots, and having that inspiration can help you get through them, hopefully until you're well practiced in getting through those tough spots. Better yet, work through it with other people and get through them together.
When learning to program later, a large part of the motivation was to make a career shift, and it was much easier to direct my energy and focus, aided by a little more maturity and practice learning as well. There was nothing quite like fielding customer support calls to help motivate me to study after work, and I stuck with it much better.
The joke is truly on me, because I now really enjoy both programming and learning.