How does one purify the mind?

The first step is to know how the mind works. The Chandogya Upanishad says that the mind works through the food it assimilates. Here food is used in the wider sense; that which is eaten is food for the tongue,