It is narrated from Imam Ali (AS) who said: I advise you to remember death and neglect it less frequently. How can you neglect a thing that does not neglect you, and how can you be so hopeful of a being who does not give you respite! The dead ones you see are themselves preachers who make you not needing any other preacher [1]. In reply to the question of: what does preparing for death mean and how must one be prepared for it? Imam Ali (AS) said: To carry out all Wajib deeds, and avoiding Harams, and learning good habits. By observing these cases, how can the human fear whether death coming towards him/her or he/she is going towards death [2].
[1] Mizanul Hekmah, Vol. 12, Hadith 19151.
[2] As above, Hadith 19209
source : en.shafaqna.com