Mantra is a tool to focus meditation.
Mantra yoga is the use of a phrase or a sound in the practice and its use is shelter from distraction. Traditionally, Mantra is passed from teacher to student when the teacher clearly sees what the student needs. In a moment of revelation, the teacher knows exactly which mantra to provide. The student receives the mantra and repeats it over and over in meditation. Mantra is a shield and protects the user whenever protection is needed.
The repetition of Om and meditating on its meaning is the wayYoga Sutra 1.28
Guru Brahma Guru Vishnu Guru Devo Maheshwara Guru Sakshat Param Brahmna Tasmal Shri Guru Vuay Namaha Acknowledge the creator, the preserver, the destroyer and the absolute guru within my own heart. Salutations to the guru within.
Om Mani Padmi Hum Six syllables to represent a path of wisdom. The path to transform impure body, mind and speech into loving speech, body and mind.
Shanti Shanti Shanti Peace Peace Peace
Om Bhuh Bhuvah Svah Tat Savitur Verenyam Bhargo Devasya Dheemahi Dhiyo Yonah Prachodyat We contemplate the divine light of the creator of three dimensions. May our intellect be stimulated and true knowledge arrive on our minds.