Looting NPC Inventory

How would I go about making a simple lootable inventory system for dead NPCs?

So say I give one NPC a pistol and some ammo also few food items, then the NPC dies and the player can go over to that NPC and loot it’s body like in Skyrim or Fallout?

How would I make this?

do you even have a inventory in place? if not then go ahead and look for some modular inventory. making a inventory isnt that simple.