you must achieve liberation during your life time.Even if you fail to do it during your lifetime, you must think of god at least at the time of death, since one becomes what he thinks of at the time of death. But unless all your life you have been thinking of God, unless you have accustomed yourself to dhyana of 'Godalways during life, it would not at all be possible for you think of God at the time of death.
Ramana Maharshi
spiritual