Learning to code from YouTube is nice but I prefer to follow a nicely structured MOOC online along with a textbook (with exercises). This not only allows me to fully grasp the key concepts while focusing on the fundamentals but also to gradually build up from those first principles. Moreover, this kind of approach is vastly important in learning mathematics.
This is not a structured curriculum equivalent to a CS degree. These courses are, in my opinion, some of the most well-developed MOOCs that are available/auditable for free online. I have added links to corresponding supplementary books that go with each course. My focus is on theoretical CS (data structures, algorithms, and their analysis, computational complexity theory), mathematics for CS (discrete math, linear algebra, calculus, differential equations), and coding (programming paradigms, data science, ML, full-stack web development, frameworks, and libraries).
* Some resources/books are not free
MITx's Computational Thinking using Python XSeries - edX - Prof. Eric Grimson, Prof. John Guttag.
This XSeries program contains 2 courses on introductory programming and computational thinking:
MIT 6.001 Structure and Interpretation, 1986 - Hal Abelson, Gerald Jay Sussman. (Structure and Interpretation of Computer Programs a.k.a. the Wizard Book)
This is MIT's classic introductory CS and electrical engineering course taught using Scheme that was later replaced by 6.0001 using Python.
CS 61A: Structure and Interpretation of Computer Programs - Prof. John DeNero, UC Berkeley. ( Composing Programs)
This is UC Berkeley's introductory course on programming initially taught using Scheme but updated to use Python since 2011.
18.01x Single Variable Calculus XSeries - edX - Prof. David Jerison.
This XSeries program contains 3 courses:
18.03x Differential Equations XSeries - edX - Prof. David Jerison, Prof. Arthur Mattuck, Prof. Haynes Miller.
This XSeries program contains 5 courses:
The following are not MOOCs but you can find some well-structured content on frameworks, libraries, and math that can be used as supplementary resources with the above courses: