I learned to code Java when I was in school, I actually asked a bunch of guys in university (at the time) on The Student Room and they sent me all their student resources which I somehow ended up reading and getting pretty good at it lol. I then eventually ended up on YouTube videos and discovered a great YouTube channel by a guy called Bucky Roberts, his youtube channel is called "The New Boston" and he was at the time the best for video tutorials, especially for Java.
Fast forward 10+ years, things have changed quite a lot. YouTube is over saturated with mostly low quality content and most of the good stuff now goes into dedicated learning platforms. As a Software Engineer, I now use LinkedIn Learning (provided by my work) to learn new tools / languages, so if you want the best quality content that's what I would use.