The mental ego cannot fathom the dismantling of self.
Some people respond by giving up.
Once they accept that fact, dying people can put closure on relationships and practical matters. It also can help them to die with a sense of peace. Open conversations with family and friends, counseling, support groups, journaling, prayer and meditation can help. So can a spiritual or religious anchor and confidence in good care and pain management. But the real work is up to the individual.