In a Nutshell:
The Ankh Shield is a hardmode accessory crafted by combining the Ankh Charm and Obsidian Shield. In total you will need these nine items found throughout your world to create the Ankh Charm; Vitamins, Adhesive Bandage, Nazar, Trifold Map, Armor Polish, Bezoar, Megaphone, Fast Clock, and Blindfold. With all of these combined, you will be immune to both knockback and most debuffs.
The two most annoying things in Terraria’s combat are almost definitely debuffs and knockback. Debuffs last long amounts of time and reduce your power or health faster than you might be prepared for and knockback will get you juggled between attacks when you’re meant to be dodging. Thankfully, Terraria is kind enough to give a solution to these problems. The Ankh Shield makes you immune to almost all debuffs and knockback. It's perfect! The only hurdle is you actually have to get it.
The Ankh Shield is an accessory that must be crafted. This means busting out your trusty Tinkerer’s Workshop for another big upgrading crafting tree. And I mean big, the Ankh Shield has the third-largest crafting tree in Terraria, beaten only by the Cell Phone and Zenith. It has a huge number of required items so it's best to try and acquire these as you play through the game.
Crafting the Ankh Shield can be broken down into four main steps; crafting an Obsidian Shield, crafting the Ankh Charm’s components, crafting the Ankh Charm, and finally crafting the Ankh Shield itself.
The first basic component required is the shield part of the Ankh Shield. This role is taken up by the Obsidian Shield, an item which makes you immune to knockback as well as fiery blocks.
The Obsidian Shield can be crafted at a Tinkerer’s Workshop with a Cobalt Shield and an Obsidian Skull.
Finding a Cobalt Shield is easy, though unintuitively not made from the actual material in Terraria, Cobalt, it is found in Locked Golden Chests in the Dungeon. This means killing Skeletron and searching through a couple chests until it's found.
The Obsidian Skull is a lot more intuitive, being actually made from its namesake. It can be Crafted with 20 Obsidian at a Furnace, Hellforge, or Adamantite/Titanium Forge.
Starting off with the first item needed for the Ankh Charm, the Blindfold. This is the only item in the recipe which doesn’t have a way to craft it from other items. Instead it's a stand-alone effect nullifier and makes the player immune to the Blindness debuff.
The Blindfold is dropped from slimes and mummies found in the Corruption/Crimson biome. The best place to farm for it is a Corrupted/Crimson Desert biome as both the slimes and mummies can spawn there.
Next in this long crafting journey is the Armor Bracing. This accessory can be crafted at a Tinkerer’s Workshop with Armor Polish and Vitamins and will make you immune to the Broken Armor and Weak debuffs.
Armor Polish can be found by killing Armored Skeletons in the Cavern layer. These Skeletons will spawn anywhere in the Caverns so they can be combined with farming for other Cavern enemies.
Vitamins are dropped by Corruptors and Floaty Grosses. Corruptors are easy to find as they spawn in the surface Corruption biome and can be combined with farming for the Blindfold. The Floaty Grosses are a bit rarer and spawn in the Underground Crimson biome and can be combined with farming for the Armor Polish.
The Medicated Bandage is one of the better parts of the Ankh Charm, making you immune to both the Poison and Bleeding debuffs, the two most obnoxious debuffs in the game. It can be crafted at a Tinkerer’s Workshop with a Bezoar and an Adhesive Bandage.
The Bezoar is simple and you might get it just from exploring the Jungle biome. It drops from any enemies that inflict the Poison debuff like Hornets, Moss Hornets, and Toxic Sludges.
The Adhesive Bandage is similar, due to enemies that inflict the Bleeding debuff being about as frequent as those who inflict Poison. It is dropped by Rusty Armored Bones, Werewolves, and Angler Fish.
Next up is the Countercurse Mantra, which makes you immune to Cursed and Silenced. These debuffs aren’t as frequent as the others but are still a huge bother when you’re inflicted with them. It can be made at a Tinkerer’s Workshop with a Megaphone and a Nazar.
The Megaphone drops from a number of enemies but the most important are the Pixies and Dark/Blood Mummies. Since you may already be farming mummies for the Blindfold, this may be a good choice. Though if you already have the Blindfold, Pixies also drop another item used in crafting the Ankh Charm.
The Nazar will drop from the rare glowing weapon enemies in the underground Corruption, Crimson, and Hallow biomes. Though these aren’t the best to farm due to their low spawn rate. The best enemies to farm are the Cursed Skulls and Giant Cursed Skulls in the Dungeon. They’re still slightly rare but not as painfully so as the weapon enemies.
The final item you need for the Ankh Charm! The Plan will make you immune to the endlessly terrible Confusion and Slowness debuffs and can be crafted with a Fast Clock and the Trifold Map.
Fast Clocks drop from Pixies, mentioned before, but also from Wraiths which are easy to spawn by just breaking Demon/Crimson altars. They also drop from normal Mummies so if you have a pure Desert biome, it's a good place to farm.
The Trifold Map will drop from enemies that inflict the Confusion debuff which are somewhat rare. Light Mummies will drop it as will Clowns that spawn during the Blood Moon. However the best enemy to farm for it is the Giant Bat as, just like normal bats, they fly right for you and will spawn in relatively large numbers in the Cavern Layer.
Now, take your Blindfold, Armor Bracing, Medicated Bandage, Countercurse Mantra, and The Plan to your Tinkerer’s Workshop to finally craft the Ankh Charm. Now you can combine it with your Obsidian Shield also at a Tinkerer’s Workshop to finally be done with the crafting tree and also finally be done with any debuff you can think of!
Being an accessory, all you need to do to use it is to equip the Ankh Shield. Once you do, you're not only immune to knockback but also this gigantic list of debuffs:
Obsidian can be found naturally on top of lava pools but the best way to get it is to pour water over lava. When water and lava meet, they create an Obsidian block and by having a body of water on top of a body of lava you can mine into the Obsidian without falling into the lava.
There are a few ways to increase spawns of enemies. The easiest two are by placing a Water Candle and using a Battle Potion but they aren’t the only ways. If your enemy can spawn at night, activating a Blood Moon with a Bloody Tear will boost spawn rates a lot and if the enemy you want to fight spawns outside of the areas where the Frost or Pumpkin Moons can affect, summoning those will also increase spawns everywhere.