“Ashtanga” is a Sanskrit word meaning “eight-limbed,” as in the limbs of a tree. The two “lowest” limbs have to do with morality and ethics — what to avoid doing and what to do in order to live a virtuous life. The first limb, called the Yamas in Sanskrit, consists of five restraints: not harming, not lying, not stealing, taking care with sexuality, and not coveting. The second limb, the Niyamas, consists of five observances: cleanliness of body and mind; contentedness; discipline; study; and the offering of one’s actions to God. Aspects of the Yamas and Niyamas are learned throughout life, even from before one formally starts yoga, but through yoga, one naturally advances their application.
The third, next higher limb is the practice of doing postures, or asanas. The practice of this limb purifies the body and stills the mind. The fourth limb is Pranayama — breath control — which strengthens the mind. In Ashtanga yoga, pranayama is taught only once a student has mastered postures. Finally, there are the four “internal” limbs of practice — pratyahara, Dharana, Dhyana, and Samadhi — essentially deeper and deeper forms of meditation, leading (if one is diligent and blessed and the preceding limbs have been properly practiced) to self-realization, the ultimate yoga.
For more: I recommend reading: Patanjali Yoga Sutra by Edwin