What’s the best way to learn D&D?
In my opinion there are three stages of learning so there are three answers.
The first stage - just playing - is so elementary than nearly everyone comes equipped with the knowledge to do it. You consider the situation and your character and then you say what your character will do. Someone else handles the rules.
The second stage - learning the rules - probably happens better at the table too. You figure out what dice to roll and why. But some people learn better from the book. And of course you can learn from people and from the book.
Lately (um, the last 20 years) though there’s a third way that’s invaluable and that’s to learn from lots and lots of other players online. I had always preferred to play in the OSR way even when I was trying to lay that play style over 3.X and 4E. Thankfully I found Dragonsfoot and realized not only was I not alone but it was OK to play old editions as well. Thank goodness!
The third stage - deep system learning I think I will call it - requires more than what’s in the books. While stage two is akin to memorizing algorithms to solve problems, stage three is like devising proofs and building new algorithms. One thing to do is to pull a system apart and make up your own neoclone or fantasy heartbreaker. When I did this, it seemed like everyone was redoing the Thief class as a warm up to making a whole new version of d&d but the Thief thing has fallen in popularity. But there will be some system or subsystem which gets your juices flowing to reverse engineer the whole thing and rebuild it in your own image.
I’m less sure about the steps to becoming a deep player or deep referee but in my mind’s eye the process must be similar, although more qualitative than quantitative. Some aspect of the actual play piques your interest enough to explore it, you learn all you can about it by deconstructing it, and then rebuild your own understanding of how it works for you and the several players.