This is why it is said that you must be ready for death every moment of your life. You should live your life in such a way that if you were to drop dead the next moment, you still have ended it reasonably well. You trying to deal with it at the last moment is not the way. Moreover, if you understand that you are mortal, you look at it all the time. And if you are looking at it all the time, you will notice it. When it is time, you will know how to sit in a conducive place and die. That is the best way.