How do I kill a specific item with a command block

I want to kill a specific item using a command block. If this is possible, how do I do this. Can you kill 2 specific items using a single command block. If yes, how?

I tried killing a gold ingot but it didn't work. Here is the screenshot. SCREENSHOT OF ME TRYING


Solution 1:

The /kill command does not support datatags. Try running the following command:

/scoreboard players tag @e[type=Item] add gold {Item:{id:"minecraft:gold_ingot"}}

Then use:

/kill @e[type=Item,tag=gold]

Solution 2:

/kill, like all other commands, supports NBT in Minecraft 1.13

/kill @e[type=item,nbt={Item:{id:"minecraft:gold_ingot"}}]