Yoga is one of the six orthodox systems of indian philisophy. It was collated, co-ordinated and systemimzed by Patanjali in his classical work, the Yoga Sutras.
In indian thought, everything is premeated by Supreme Universal Spirit(Paramatma/परमात्मा) of which individual spirit(jivatma/जीवात्मा) is a part of. They system of yoga(yoga means union/sum) this so called because it teaches the means by which the jivatam can be united to, or be in communion with the Paramatma, and so secure liberation(moksa). To get moksha is final goal for any individual.
When the mind, intellect and self(ahankara) are under control, freed from restless desire, so that they can test in the spirit within, a man becomes a Yukta
Patanjali also describe the yoga as
chitta vrtti norodhah
Yoga is method by which the restless mind is calmed and the energy directed into constructive channels.
The problem of controlling the mind is not capable of easy solution as borne out by the following dialogue in Bhagavad Gita
Krishna you've told me the Yoga is communion with Braham(the Universal spirit/ब्रह्म), which is ever one, but how can this be permanent, since mind is so restless and inconsistent? The mind is impetuous and stubborn, strong and wilful, as difficult to harness as the wind. Shri krishna replies: undoubtedly, the mind is restless and hard to control. But it can be trained by constant practice(abhyasa/अभ्यास) and by freedom from desire(vairagya/वैराग्य). A man who cannot control his mind will find it difficult to attain this divine communion; but the self-controlled man can attain if if he tries hard and directs his energy by the right means
Yama and Niyama(नियम:) control the yogi’s passions and emotions to keep him in harmoney with fello man. Asana keep body healthy and strong and harmony with nature. Finally, the yogi becomes free of body conciousness. He conquers body an drenders it a fit vechile for the soul. The first three stage are outward quests(bahiranga sadhana)
Next two are teach aspirant to regulate the breathing, and thereby control the mind. This helps to free the senses form the thranldom(i don’t what it means) of objects of desire. Two two stages are of Yoga are called inner quests(antaranga sadhana).
Daranana, Dhyana and Samadhi take yogi into the innermost recesses of his soul. The yogi doesn’t look heavenward to find God(Param-atma/parmatma).
Samadhi is end of sadahaka quest. At the peak of dhyana, he passes into state of samadhi, where his body senses are at rest as if he is asleep, his faculties of mind and reason are alert as he is awake, yet he has gone beyond consciousnes. The person is state of samadhi is fully conscious and alert.
Mind is king of the senses, One who has conquered his mind, senses, passions, thought and reason is king among men. He is fit for Raja yoga, the royal union with Universal spirit. He has Inner light.