The college situation isn't quite that dire. Especially for someone whose parents are of limited means and/or who is gifted and applies himself.
The top 0.5% of students get national merit, which basically gets them a free ride to some fairly decent state schools. Not the best state schools, but not total slouches either.
Minority students can get something similar to national merit with lower scores on the exact same test. Many universities reward those awards just like the other ones. So figure maybe...0.75% to 1.0% of all college bound students have the option of a free ride.
A couple of places were willing to cover my costs purely for my score on the math portion of the SAT, irrespective of all the national merit stuff. So if you bomb the PSAT you can still potentially qualify for free money by way of your SAT score.
If your parents are low-income and you can manage to get admitted to one of the ultra-top-tier schools (e.g. Harvard) you'll probably attend for free. (At Harvard, currently, if your parents' household income is lower than $65k you attend for free.)
Another 1-2% of students get athletic scholarships.
You can work during school. You can work during summers. You can place out of some classes via AP tests. You can take classes at a cheap community college and transfer them in. You can either get support from your parents (if they can afford it) or you can apply for need-based grants. Even low-income parents can usually afford to let you keep living at home while you're going to school, even if they can't help with tuition.
Whatever's left (which will potentially be much less than $40k) you can finance via loans. If you apply yourself while in school, choose a marketable degree and attend a half-way decent school, the odds of your being completely unable to find a job after graduating are fairly low.
Should you decide to seek a law or medical degree you can choose a program with loan forgiveness, finance your entire degree, then commit to doing relatively low-paying public interest work until your loans are paid off.