Train the mind to make it unable to remember anything other than Krishna
At the time of death, the mind and intelligence of a living entity create the subtle form of a certain type of body for the next life. If the mind suddenly thinks of something not very congenial, one has to take a corresponding birth in the next life. On the other hand, if one can think of Krishna at the time of death, he can be transferred to the spiritual world, Goloka Vrndavana. This process of transmigration is very subtle; therefore Srila Rupa Gosvami advises devotees to train their minds in order that they will be unable to remember anything other than Krishna.