So, what's the obvious takeaway? Read the books, all of the books, many many times. Take notes. Underline and highlight. Put little labeled flags next to frequently used sections and tables. Write down rules in your DM notes that may come up in the session (navigating at sea or drowning for an aquatic adventure for instance). Be especially familiar with the table of contents and the index. Know the rules. Know how to access the ones you don't know. I must have read the 3.0 Player's Handbook at least 10 times cover to cover before I had ANY clue how to play. I was 10 at the time but still. Know the rules.
Know rules about races, sub-races, changing races, new races, monsters as races. ALL OF THEM!
But why? What's the worst that can happen if you don't know every minor detail?
I had a friend -- I'll call him Nate -- who was what we like to call a "Rules Lawyer." Nate was a biomagnet of wrongness. Almost every turn in combat, and at least once every five minutes, Nate would spout off some bullshit about a rule that would inevitably start an argument. These lasted way too long, happened way too often, and would always result in 1) the DM looking up the rule (the thing that could have been done from the beginning), 2) Nate not learning or retaining the rule in any fashion, and 3) me wanting to smash a two-liter of Mountain Dew through my eye socket. We spent more time not playing than we did playing, and that's not fun. Eventually, I learned to scream out rules text verbatim as soon as these situations developed instead of waiting for them to resolve naturally. Don't be like Nate. Be cool like me. Learn the fucking rules and KEEP THE GAME MOVING.
But It's Easy To Overcorrect ...
If not knowing the rules is the Roman Reigns of roleplaying, slavish adherence to the rules is the snooty, evil Vince McMahon who allows it a microphone. Once you've learned all the rules, it's natural to want to use every last one of them in every single instance, but unless you really have everything memorized, that means looking a lot of things up. Looking things up is important for a DM, but just as important is knowing when to just wing it. Not all rules are created equal, not all are easily executed or equally relevant to your average game, and not all are worth the effort.