Death is indiscriminate. It takes anyone at anytime. There is a sequence for coming into this world, i.e. first the grandfather, then the father and then the son. However with regards to leaving, there is no system. The grandson may pass away while the grandfather is still living. We all have to return to Allah Ta‘ala. However, what we need to see is how can we make the return journey enjoyable and pleasant? The answer is simple: Make your life pleasant and beloved to Him, and He will make your end pleasant and enjoyable to you.
Source: Al-Haadi