The Sage Patanjali was the first to lay out the discipline, philosophy, purpose, and practical method of Yoga in one text. Through this text, communicated through aphorisms, we are introduced to the Yamas and Niyamas,
Yoga is a difficult path that requires real self-examination and a hard look at ourselves in order that we may move in the direction of true peace. Consciously resolving harmful thought patterns and replacing them with positively nourishing thought patterns is what is behind Yama and Niyama.
Photo of Patanjali statue by Alokprasad on Wikipedia.org