Just noticed I posted in the wrong section. Can this be moved? Sorry about that.
Depends on what mobs.
Most kinds can be defeated by nothing more than shielding and hacking with stone axe or slashing with stone sword, sometimes you need to assist yourself with bow/crossbow. The difficulty is all up to approach and tactics, most of the time you just can't brute force your way through. You are infantryman, not Panzer IV, never forget.
1. Spider - speedy melee - axe hit, reverse, then shield up, after bounce hit, reverse, shield up... against individuals you may hold your position. Be prepared to be hit, wear armour, have high-saturation food.
If you want to prevent them from entering your area, build wall with overhang (placing 2 thin wall blocks and a full block on top will do);
On day you got guaranteed first strike on spiders.
They are also 2 blocks wide, so with proper setup you can filter them out and use 7. z-iglin tactics.
1A. Cave Spider - as above. On easy it doesn't poison you, lucky dude! (on normal and hard bring large amounts of honey or milk) Just remember that it can fit through 1x1 gaps, it's more narrow than ordinary spider.
2. Skeleton (and Stray, that one in rags) - when you see arrow in his bow, shield up! When shot, sprint and either axe x1 or sword x2. Still shield up when seeing arrow (might be tricky against many, so mind how you approach them to take on them one by one. You might also draw attention of one, retreat, and once skele is away from other skeles, deal with him as I described);
Alternate way - let zombie or spider walk between you and skele, and watch as the melee mob begins to beat up the skeleton carry on with the fight knowing that the skeleton is done once melee mob lands its hit.
3. Zombie (and husks, desert variants, and drowneds, naval variants) - circle around on "a" or "d" + slash with sword, no shield needed. If they apporach from many sides, circle them and let them group into a blob, they will be easier to handle.
3A. Baby zombie - that one is dangerous. Either sprint away (tap, release, tap and hold "w", or press ctrl while holding "w") to shoot them with ranged weapon, or deal with like a spider, or like with z-iglins via bunker.
3B. Drowned with tridents - tough lads. I recommend skeleton treatment, but there is no indicator when they are about to throw, so you must remember how often they throw and synchronise.
4. Creeper - sprint > axe hit > backpedal > repeat.
Alternative I - shield up and await the explosion, useful to kill big blobs of other mobs that don't care that the creeper is 'bout to gib them.
Alternative II - creepers are afraid of cats.
5. Enderman - Build 3x3 roof that leaves a 2-block high gap or water pool, go in the center, stare, slash legs when he gets close. Alternatively, full iron gear and iron sword berserk. Be aware of surroundings, endermen use flanking tactics in rage.
6. Witch - berserk sword slashing or repeative sniping with bow/crossbow (this is rare mob, so you will rather have arrows from killed skeles at this point)
7. Z-iglins - bunker time! Dig a 1-block deep 3x3 hole, cover the surface part with inverted slabs so that if you crouch-walk inside you can slash whatever comes close to the covered hole, place a block-thick layer on slabs to prevent anything from climbing on the top, lock off the enterance with some door or trapdoor (wooden door does not work on hard, but does on easy), provoke a z-iglin with arrow shot/snowball/egg/fishing rod, and let all the bastards come and slash them all, every single one will be laughably easy target as long as you are inside the bunker and there are no 1x1 gaps the baby versions can walk through.
If you manage to separate them from reinforciments, spider treatment. Just beware heighened damage due to swords.
They are said to become neutral after you die.
They tend to glitch so that they stay hostile. You might want to stay in their proximity, but with no line of sight to let them chill.
8. Piglins - Wear gold armor. Fun fact, if they are attacking you because you don't have armour now and you haven't attacked back, and you put on gold armour, they will cease hostilities.
Treat swordlins like strong spiders, and crosslins like skeletons. Considering they come in small squads, it might be wise to kill off crosslins with a bow/crossbow, remember they can shoot into the bunker, and that swordlins don't care about friendly fire, but still are vulnerable to it.
Soul fires (campfire, torch, lantern) will keep them from entering an area as long as they don't enter "we must kill you" mode.
9. Ghast - shoot with bow and scoot away. You might try bouncing fireballs back to the sender, but that's risky and needs good timing. Remember that ghast fireballs fly very slowly, and as such, moving even a few blocks will make it miss. Cobblestone/nether brick/blackstone/etc. platform will give you advantage, it is not deformable by weak fireball explosions and doesn't ignite when struck by fireballs, unlike netherrack.
10. Wither Skeleton - Roof up (3x3 at least), like in case of 5. enderman. Will patiently wait in front of headbumper letting you slash them with sword, because WS is 3-blocks tall and, like other undead mobs, has no clue what crouching or crawling means.
Alternatively give spider treatment, but beware - these guys hit really hard. Two are manageable with shield and stone axe, three, barely, with full iron armour, iron axe and shield. Make sure you got cooked meat ready, or their wither (poison, except it can kill) will finish you off. And that's on easy. Roof/low ceiling is practically a must. Luckily, they have average health, so if you have your flanks secure, you can just shoot them out with bow/crossbow. Just remember that flame bows don't ignite them.
11. Blaze - Axe + shield, retreat when needed. Blazes are more of defenders than typical hostiles, while they wander around, they do not give chase. Good news - you can always retreat and eat meat to regen. Bad news, no picking them one by one from groups.
Oh, and important thing - do NOT get into point blank - keep slight distance, because they can deal damage if you get too close with sheer heat. Easy to do, they give no chase.
If they are in the air, rather than hacking with axe or slashing with sword use bow or crossbow. Or snowballs! No joke, they actually damage blazes, unlike the rest of the mobs! Just remember that snow golems rapidly melt in nether.
If you don't want to farm blaze rods off spawner blocks (are you serious?!) just blitz the spawner with diamond pickaxe before it spawns anything.
12. Hoglins - spider treatment, except you can use warped fungi to make them keep some distance, but the border is soft. Watch out - while they strike slowly and are general dimwits, they are tough like endermen and their tusks deal solid damage over increased range and throw you around. Either take one on one or gear up. Shield helps a lot, you might hold position easily. Avoid fighting over cliffs, they knock you back even if you shield.
Small ones run away after being hit once and stop retaliating, they are more of a nuisance.
12A. Z-oglins - as above, except they are always hostile and can't smell warped fungi.
13. Wolves - right click using bone on it to tame them! If their eyes are already red and they attack you, spider treatment. If their eyes are red, but they attack skeletons, you might tame them after it's over.
14. Slimes (green bouncy things) depends.
Big - actually dangerous. Better snipe them off or be ready to take some damage, they have solid range. Do not shield from it, just slash ASAP with sword.
Medium - zombie treatment
Small - harmless, leave for the end, they just push you around.
15. Magma cubes - zombie treatment regardless of size.
16. Illagers - they are meant to be the tough guys. Better gear up in iron, and do not spare arrows. I recommend taking good positions and gibbing them by barrages of firework crossbow fire before mopping them up with sword and bow/arrow-crossbow. Prioritise evokers - they will spawn vexes that are annoying as hell.
Shield is of lesser importance, it helps to evade pillagers, but is of little use elsewhere. And you stand the best chances shooting them either way, for they are very fast-moving.