Neither death nor dying are something that most people want to think about, but in the Buddhist tradition, these reflections are an important part of the practice. One reason is that they help give one a sense of urgency. Knowing that our time here on Earth is finite and relatively short, with death itself often being unexpected, we're motivated to use the time we do have wisely and develop the tools we'll need to confront death with a stable footing when our time comes. Another reason is that such reflections help remind us of the inconstancy of conditioned things, like our minds and bodies, and how little control we truly have over them:
Aniccà vata sankhàrà.
Tesaü våpasamo sukho.
Impermanent are all conditioned things.
Of a nature to arise and pass away.
Having arisen, they pass away.
Their calming and cessation is true bliss.
There's a lot of good we can accomplish in our lifetime. There's a lot of joy and happiness to be had as well. But by living heedlessly and ignoring the nature of reality, we run the risk of confronting death unprepared, whether that of a loved one or our own. Because we are born, death is inevitable, but we rarely seem to plan for it. All of the things we accumulate throughout life, wealth, possessions, status, relationships, etc., can't go with us; and yet our lives are almost solely focused on acquiring rather than letting go, so when it comes time to part with that which we hold dear, we sorrow, grieve, lament, beat our breast, and become distraught.
We all must face death numerous times in our life, and countless times if you believe the teachings on rebirth. For that reason alone it's worthy of our attention. From the Buddhist point of view, it's only with the cessation of birth that there's the cessation of death; and being mindful of death leads one to heedfulness—to developing mindfulness for the sake of ending the effluents of the mind. When mindfulness of death is developed and pursued in the proper way, it gains a footing in the deathless, and has the deathless as its final end. And even when our minds and bodies fall apart, there will be peace in the heart.