Start from a dungeon spawner
Natural dungeons with zombie or skeleton spawners are the best first farm: the spawner activates when you are within 16 blocks, spawns in a 9×3×9 area around it, and needs only darkness. Dig around it, expose the spawner room, and plan a collection floor 2 blocks below the spawner.
The water funnel and the drop
Place water in the back corners of the room so currents push mobs toward one point; dig a 1×2 outlet into a falling shaft 20+ blocks deep. The drop leaves mobs at half a heart — you finish them with one punch through a slit, which routes all XP to you. Mobs killed purely by the fall drop loot but no XP.
Light control is the whole build
Torch every dark corner of the room and the shaft ceiling — hostile spawns need light level 0 in modern versions. Stand within 16 blocks of the spawner to keep it active, and AFK-punch from the kill slit for hands-free sessions. Skeletons give bones for bonemeal (crop booster) and arrows; zombies give the iron-farm-adjacent loot and 5 XP each.