Your average American kid has already won a genetic lottery. Being born and raised in America is already great.
I grew up the kid of immigrant parents from an African country and I am an immigrant myself at 5 years old. I have a great job at a major well known tech company in a technical programming position.
I'm not the kid that got straight A's. I was the smart fuckup. I almost flunked out of high school. I dropped out of college. I could barely program worth a damn out of college. It was hard work learning not only how to program but, all of the other skills that college didn't teach but, are critical to a working professional programmer (git for instance).
Now, I'll argue there weren't a bed of nails. There were a bed of pillows. I had to move back in with my parents multiple times through my twenties. I thought back then that I was walking over a pit of spikes but, it turns out I wasn't.
Today is much different than even a decade ago, so much more than a generation ago.
You can teach yourself how to program. You can work a minium wage job while you teach yourself. You can't do it in LA, SF, NYC but, you can live in the parts of the US that no one talks about and learn.
It takes time and dedication but, one can do it.
I fully financially supported my brother for two years and he didn't learn or do really anything with that time other than barely pass a bad coding bootcamp and then struggle to find a job with that inadequate education.
The greater difference is the person and their perseverance than economic circumstances. As a poor person who made it by screwing up again and again and again and again. Unless I have astronomical luck, I really don't think it's that hard.
Seriously, if you have the intelligence to program, you should be able to find a minimum wage job or what I did, work nights doing security. I learned programming (reading programming books and coding) while I watched warehouses, trucking depots and the gate at gated communities. It was still a fuckton of hard work but, the hard part was the programming not figuring out how I was going to feed myself.
Maybe I'm somehow this unicorn of blind exceptionalism but, while I felt depressed and that it was hard at the time, it doesn't feel that hard now. I just kept working and it was more of less inevitable. Even today, I keep telling my brother that if he keeps working at it, it will eventually work.