This is a very tricky question. Personally, am always reading the Bible in case of such weird thoughts. There are several books which talk about death. Besides I always consult myself that death is a journey which everyone must follow. When you make this assumption trust me, the thoughts will get off your mind.
On the other hand, I believe in the saying, 'make hay as the sun shines'. At the moment you're alive, live life to the fullest and don't let thoughts of death disturb you. If it's living a righteous life, then do so, if is living a party life, then do so. In the long run, you won't be available during your death but only your body neither you won't feel any pain during the death.