Imam Ali (AS) was asked: How to prepare for death and transfer to the next world? Imam Ali (AS) replied: Act on Divine Commands (religious duties) and stay away from Harams, and domination of morality on inside and outside (of a person). Then for a person who is equipped with these truths, there is no fear of death. Swear to God, the son of Abu Talib has no fear or worry about death [1].
[1] Al-Amaali, Sheikh Sadooq, Page 172.
source : Shafaqna