The Aṣtānga Yoga is written by the great sage Patanjali in the form of 196 aphorisms or sutras and is one of the Śat Darṣanas. It is called so because it involves 8 limbs or steps to attain the union with the supreme consciousness. Patanjali defines the first five steps of Aṣtānga Yoga in the second chapter - Sādhana Pāda and also named it as Kriya Yoga.
Yama is the first limb in the Aṣtānga Yoga. As Yogacharya B.K.S. Iyengar defines Yama to be the roots in a tree, it forms the foundation for an individual who is in the path of Yoga. Patanjali defines Yamas as follows Ahimsāsatyāsteyabramhacharyāparigrahā yamāha. (Patanjali Yoga Sūtrās 2.30). The Yamas are five disciplinary principles which one needs to practice with the society. The five principles are Ahimsa, Satya, Asteya, Brahmacarya and Aparigraha.
Ahimsa: is to practice non violence through our thoughts, actions and words. Violence is lack of love. Without enmity, no act of violence can be performed. Only love can make the society cohesive. Violence is the outcome of fear, selfishness, anger and lack of confidence.
The classic example would be Buddha who practiced non violence throughout his life and attained mokśa through it. Patanjali says that anyone who comes in contact with a person who is devoid of violent thoughts is bound to cast off feelings of enmity.
The next is Satya: meaning to tell the truth. One has to tell the truth in any situation and under any circumstances. One has to speak the truth, that which is pleasing but not which is unpleasing and neither the untruth which is unpleasing as said by the Mahabhārata. Satya Hariśchandra told truth at the sacrifice of his own wife and son.
Asteya: is not stealing. Not stealing has to be practiced even through our thoughts. One should not even think of having someone else’s possessions as this is considered to be stealing.
Aparigraha: is non covetousness. That means not to be very materialistic in our lives. What is required, only so much one should possess.
Brahmacarya: means celibacy. The senses should not be distracted from being focused on the supreme consciousness; otherwise one is deviating from the path of Yoga
The second limb in the Aṣtānga Yoga is Niyama and it forms the trunk of the tree. The Niyamas are five principles which is to self discipline oneself who is in the path of Yoga. Patanjali defines Niyama as follows: Śouchasantoṣatapah svādhyāyeśvaraprańidhānāni niyamāh. ( Patanjali Yoga Sūtrās 2.32). The five Niyamas are Śouca, Santoṣa, Svādhyāya, Tapas and Īśvarapraṇidhāna.
Śouca means cleanliness and it is of two categories, external and internal. Cleanliness is to have a clean body and as well a clean mind. This is by having bath daily to keep our body clean and by having positive thoughts, not thinking ill of others to have a clean mind. One can have clean mind by showing compassion to others who are in need of it.
Santoṣa is to be happy. One has to be happy in any situation of life. This can be achieved only if the person is contented with his life. Contentment should be with respect to everything to start from having contentment with materialism.
Svādhyāya means self study. That means to study all the ancient scriptures such as the Vedas and the Upanishads. This gives one all the knowledge as to how one has to lead a life. Svādhyāya also means to study our self i.e. to analyze the mistakes which we commit and try not to repeat them.
Tapas come from the word Tapa meaning the burning desire to practice. It purifies the body, mind and senses. Any kind of task should be performed with determination and commitment.
Īśvaraprańidhāna is to surrender ourselves completely to god. One has to surrender all the actions to the will of supreme consciousness. This forms Bhakti Yoga.
Yamas and Niyamas form the firm foundation for the individual towards spiritual experience.