Given consistency, the child will soon reach out for an item and immediately pull back their hand because the child is automatically asking the question to him/herself. Because I am paying attention when I am working with a child, I can then congratulate them on good thinking.
There is a question for most problems I can think of. Another example: I ask a child that makes rude comments often, "Is it helpful?" When the child rolls eyes, curls the lip, speaks in a belittling manner, they know what is coming, "Was your comment or gesture helpful?" We talk about, "Did it make your relationship better?" Sometimes the answer is, "Well I don't want a relationship with that person." "Nevertheless," I reply, "since we all live in the same house will your comment make things better or worse for you and everyone?"
While this is not a "quick fix", in the long run the child will respond and learn a better way to think and behave.