First of all, you need to have the Looting enchantment for your sword. Additionally, it would be best to get books in your inventory for this enchantment. Then combining the books with Looting enchantment will earn Looting III for your sword. You can get the Looting III perk by setting up a villager’s farm.