I once bought a programming book in the 1990s. Since then, I never found the need for it anymore: you could simply find all the resources you needed online (and long before ChatGPT).
StackOverflow is kinda forgotten now, but there was a time where you could find the answers to pretty much all your programming questions there, and if not, you could simply post a question yourself (and yes, there was a time where SO was pleasant to use and your question didn't get immediately shut down by overzealous admins).
I personally never liked learning a programming language from a book. Like, in the early days of Java, I would get so much more use out of the then excellent API docs than out of secondary material.
And of course, programming is one of those disciplines where you really have to just try it out to really make progress.
Books make the most sense as a guide, not a tutorial or a reference