As Lord Kṛṣṇa says in Bhagavad-gītā (4.9):
janma karma ca me divyam
evaṁ yo vetti tattvataḥ
tyaktvā dehaṁ punar janma
naiti mām eti so ’rjuna
“One who knows the transcendental nature of My appearance and activities does not, upon leaving the body, take his birth again in this material world, but attains My eternal abode, O Arjuna.”
This is possible simply by keeping oneself an eternal servant of the Supreme Lord. One must understand his constitutional position and the constitutional position of the Supreme Lord as well. Both have the same spiritual identity. Maintaining oneself as a servant of the Supreme Lord, one should avoid rebirth in this material world. If one keeps himself spiritually fit and thinks of himself as an eternal servant of the Supreme Lord, he will be successful at the time he has to give up the material body.