If you're new to the hobby, you may not have ever heard about THAC0, or you may only have encountered it in video games like the classic Baldur's Gate. There's no real reason to know anything about THAC0 now, of course, because neither Pathfinder or 5e use it. However, if you want to turn back the pages of time and actually play a 2e adventure, you have to learn THAC0.
THAC0 has somewhat of a poor reputation, because I guess in retrospect it wasn't as graceful as modern mechanics. But it's not as bad as people make it out to be, so read on with confidence.
THAC0 stands for "To hit AC 0", and even the old "Introduction to D&D" book said quite plainly "but don't worry about that. All you need to know is that the THACO measures how good your character is at attacking."
I won't argue with TSR about D&D, so don't concern yourself with what THAC0 means. All you really need to understand is that THAC0 is your attack roll.
In Pathfinder and 5e, an attack roll is pretty straight-forward. You roll a d20 for some number. You add any bonuses to attack that you may have to that number, and then tell the DM what you have calculated.
The DM refers to the monster manual to see whether the monster's armor class (AC) is equal to or lower than the number you have produced.
If you rolled equal to or higher than the monster's AC, then you have hit it, and so you move on to determining how much damage you have dealt.
During character creation, you calculate THAC0 based on class. Lower is better.
For instance, fighters started at 20, and decremented by 1 each level (at least to a certain point; I never played beyond level 3 or 4 or so). Wizards started at 20, got 19 at level 4. And so on.
THAC0 sometimes changed depending on a specific weapon or when attacked with a special kind of attack (such as a backstab).
When you attack, you roll a d20 and subtract your number from your THAC0. If the resulting number is lower than the monster's AC, then you have hit.
Here's an example.
You're attacking a bozak draconian. You roll a d20 and get a 9. Your THAC0 is 19.
19 (THAC0) - 9 (your roll) = 10
If the bozak draconian has an AC 10 or worse, you have scored a hit. Unfortunately, the 2e Monstrous Compendium lists bozak draconians as AC 2, so you do not hit.
You gracefully disengage from the draconian so your fighter can get to it, and you attack the bakali lizard man instead. This time you roll 7.
19 (THAC0) - 13 (your roll) = 6
A bakali lizard man has AC 7. So you hit!
A related stat is your armor class (AC), which measures how hard it is for a monster to hit your character. Like THACO, lower numbers for this were better in 2e.
A human with no armor has a natural AC of 10. You might have a bonus to AC depending on what you're wearing or how good your DEX score is (your AC actually remains the same, but you might gain a defense bonus).
You don't use your AC when you are attacking, but you do use it when you are attacked. Each monster has its own THAC0, so when one attacks you, the DM tells you what its attack roll has produced (monster THAC0 minus the attack roll and any applicable bonuses), and then you tell the DM your current AC (plus or minus any applicable defensive bonus).
If the monster's attack was lower than your AC, then you have been hit.
One more related topic: death. When your hit points reach 0, you fall unconscious. If you lose 10 more hit points, then you are dead.
That's it. That's THAC0. The trickiest part about it is remembering, in these elegant modern times, that lower is better for THAC0 and AC. The way I remember is the 0 in THAC0. Getting as close to 0 is what you want.
Before you get too excited about THAC0, though, consider this: you may not actually need to learn THAC0 in order to get an old-school D&D experience. There may be some flexibility.
These days, there are "retro clones" out there that provide you a very similar 1e or 2e D&D experience, but with modern mechanic sensibilities. By that, I mean that you get quick character creation, consistent targets (rolling high is always better, for instance), and so on. If you've played a few modern games, and you're not too concerned about rigid rules, you might even be able to adapt old 2e modules to your retro clone game as you play.
On the other hand, D&D is a game, and there are rules and mechanics and if you play actual 2e, with THAC0 and reverse AC and defense bonuses and all of those things, then the whole 2e catalogue is yours to explore, from Dragonlance to Planescape and everything in between.
Character sheet by TSR.