Intense devotion to God is known as Ishvara pranidhana in Hinduism. Pranidhana means intense devotion. Ishvara is God. In Yoga Shastra God is not looked upon as the creator of the universe. Yoga shares most of its philosophical presuppositions with Samkhya. Yet, unlike Samkhya, which is frankly atheistic in outlook, the Yoga system recognizes God. His grace is obtained by intense devotion, and this grace helps the seeker to attain Samadhi.
Patanajali has described God as purusha visesha (a special type of soul) who, unlike other souls, is ever free from afflictions (karma) and their binding effects (Yogasutra I.23-24). The Bhagavad Gita affirms such deliverance in the words of Sri Krishna Himself. There He says that He would deliver those who depend on Him from the ocean of birth and death because they surrender all their actions unto Him and constantly meditate on Him with single-minded devotion (Gita XII-6 and 7).
But devotion to God is not the only way to attain the goal of Yoga. It is only one among the various means available to a seeker. It means renouncing all deeds to the will of God, and giving up all desires. This is similar to the karma yoga of the Bhagavad Gita. Devotion to God is also included as one of the three parts of kriya yoga, which is said to promote attainment of Samadhi by overcoming the mental afflictions (Yogasutra II 1-2).
Patanjali Maharishi has also recommended recitation of God’s name and concentration of the mind on God as a means of self realization and removal of obstacles on the path of Yoga, such as ill health, dullness, doubt, impertinence, lack of drive, worldliness, illusory ideas and failure to stabilize the mind.
Intense devotion to God is also said to lead to true knowledge of the true nature of the self. (Yoga Sutra I.29).