Pranayam is the yogic art of breathing.
It consists of long, sustained inhalation (puraka), exhalation (rechaka) and retention of breath (Kumbhak).
Purak stimulates the system.
Rechaka throws out the toxins and bad air from the body.
Kumbhaka distributes the vital energy throughout the body.
Thus the purpose of pranayam is to inspire, motivate, regulate and balance the vital force or prana inside the body. That is why pranayama is called the soul of yoga.
As bathing is necessary for purifying the body, similarly pranayam is essential for purifying the mind.