How do I set up a basic inventory using bools?

I am trying to set up a simple inventory where upon picking up an item, it is stored until it’s relevant again. I was told I could use a bool to say “HasItem” to activate it, but I’m very lost honestly. I’m trying to use a line trace to pick up the item and destroy it while putting it into an inventory of sorts. Have I done something wrong?