Change the color of a selected box

Hello, could someone explain to me how to do the same thing as the video below, that is to say that when you pull on a box, it is surrounded by a different color from the others to clearly show that it is she who is selected. Thank you and have a good day.

Explanatory video