Restraining all the senses, a self-controlled person should fix his mind upon Me. Thus he becomes firmly situated in divine knowledge.
Bhagavad Gita - Chapter 2 - Sankhya Yoga - The Yoga of Analysis
By meditating upon sense-objects, one becomes attached to them. From attachment desire appears and from desire anger manifests.
Delusion manifests from anger. Delusion causes bewilderment of memory. Bewilderment of memory causes loss of intelligence and when intelligence is lost, one is destroyed.
However, one who can control his mind and senses, and is free from both attachment and repulsion, even while in the midst of sense-objects, attains divine grace.
When one attains divine grace, all miseries cease. Certainly, such a person who achieves a tranquil mind develops divine wisdom.
One who is bereft of self-control cannot attain wisdom. Without wisdom one can never meditate. One who cannot meditate cannot achieve peace, and without peace how can one attain happiness?
Whichever sense the wandering mind becomes absorbed in, that sense carries away the intelligence, just as a ship at sea is swept away by a strong wind.
Therefore, O mighty armed Arjuna, one whose senses are fully withdrawn from the sense-objects is firmly established in divine wisdom.
That which is day for the self-controlled sage is night for all living beings, and that which is day for all living beings is night for the introspective sage.
Such a sage who is steadfast in facing the constant flow of desires and who does not strive to satisfy them achieves peace. He remains unaffected, just as the ocean remains calm as rivers enter into it.