How can I remove a specific item from my inventory when I die?

How can I remove a specific item from my inventory when I die?

For example, I want my weapons, materials, and ammo to be dropped.

However, I don’t want my healing to be dropped when I die.

Does anyone know any code that can help me?

You can use the item remover device