O Partha, that Supreme Person, within whom all living beings are situated and who pervades the entire creation, can only be attained by bhakti-yoga.
Bhagavad Gita - Chapter 8 - Taraka Brahma Yoga - The Yoga of the Supreme
O best of the descendants of Bharata, I shall now explain to you those times that the yogis attain either liberation or rebirth at the moment of their departure.
Those who know Brahman pass from this world on the path of fire and light, during the time of the waxing moon or during the six months when the sun traverses the northern hemisphere.
Departing on the path of darkness, during the night, during the waning moon or during the six months when the sun makes its course across the southern hemisphere – that yogi attains the celestial lunar planet, but then returns.
Both these paths of light and darkness are accepted as being permanent in this world. By one path, one does not return, by the other path, one returns.
The yogi who knows these two paths is never bewildered. Therefore, O Arjuna, at all times be fixed in yoga.
Knowing this, a yogi surpasses all kinds of pious results that are achieved through study of the Vedas, by offering oblations in sacrifice, by penances and by philanthropy. That yogi reaches the eternal abode.