Devotion to God considered one valid path of yoga towards mokṣa. It is called bhakti (devotion) yoga.
Bhakti yoga is described in the Bhagavad Gītā, where devotion to the god Kṛṣṇa is one effective way to achieve spiritual emancipation.
In the system of devotion to God, a mental-spiritual understanding of ultimate reality. Instead, surrender of one’s ego to God is all-important.