Code gives error

I want to make it so you inspect the item for 2 seconds and then it gets removed from the screen. What would I need to change?