The key to D&D tanking is, depending on the DM, making yourself as obnoxious to the enemies as you can be. The goal isn't to have ALL of the enemies focusing on you, like in an MMO, but to have as many as possible focusing on you. This can be done by being a big threat with huge damage like paladin smites, verbally taunting the enemy (with or without checks), or just doing something to seem like you're more of a threat than you really are.

in one game I'm in, the party's 'tank' is a paladin. 24 AC, 25 using a reaction. We are at level 20 now. When she hits things, they feel it. And she is very good at interposing herself between the enemy of the squishy casters. Party is Paladin, Cleric, Wizard, Rogue, and Sorcerer. Wizard has a Robe of the Archmage so disadvantage on attacks until hit, plus free Shield, so incredibly hard to hit. Sorc is the easiest to hit but he just shrugs things off so easily due to various resistances. Sorc rarely actively participates in battle battle though. The standard strategy is Rogue hits hard then goes back to the shadows, casters disrupt or buff, and the paladin is large and in the enemies faces. Well, as large as a five foot, 110 lbs soaking wet elfess can be.

In another game our wizard (level 7) tanked the blue dragon. How? Absorb Elements and a literal death wish (for the character). And yet the old man was still tougher than old boot leather and kept surviving. The dragon wasted a full breath weapon on just him, blasting him into the floor, because he taunted the dragon about breaking one of his treasures. if the dice had rolled 2 higher, he'd have been completely, instantly dead, even with Absorb Elements.