Need explanation to make a frame of different colors when you select something.

Hello, could someone explain to me how to do the same thing as in the video below, that is to say that when you pull on a box, the box changes color to clearly show that it is selected . Thanks for your help.

https://youtu.be/5Yrl7gM17A4?si=dhyXg85DQsnHhNPn