chest gui help

how can I make it so when a player puts their item in a slot I don't want to be available it's put back in their inventory?
Continue to help post