I know a man now in his eighties. He has led a successful and fulfilled life. He rose high in his profession and was widely respected by his peers. He had a happy marriage with several children and now has numerous grandchildren who love him and whom he loves. His life has not been without suffering but, on the whole, it has been a good one. And he's a good and honourable man. But he has no religious belief at all. As far as he is concerned, it's all childish nonsense, wish fulfilment and make-believe.
Now he is wracked with pain from various ailments to do with old age. Worse, his wife may be dying and he won't be far behind. He is frightened.
He reminds me of my own father who was always a proud (in a good way), independent, self-reliant sort of person but who was brought low by a stroke and became a shadow of himself. He had a vague religious belief but had left it to one side for most of his life, seeing it as something that wasn't really that important compared to the actual reality of life here and now. It wasn't strong enough to sustain him when it came down to the wire. Both these people come to the end, the point to which all lives inevitably tend, and suddenly are faced with the bitter (to them) truth. This is it. There is no more. All pleasures have faded and disappeared, past joys and happiness really are past. They are dust and ashes. There is nothing left but pain, suffering and then darkness. Non-existence. There was never any meaning in anything.
This is a truly pitiful state to be in. It leaves the person in it with few options. Some might think there is a kind of bleak heroism in defiance, in saying I have lived my life and have no regrets. Death, do your worst! Perhaps there is but I think this is really just bravado. It achieves nothing. And it is prideful. Most people are not able to be like this anyway. They, like the person I describe above, become frightened. The reality of life and death, hitherto not fully thought about, becomes apparent and they risk being overwhelmed and dying in a state of hopelessness though I believe that at the end people are often aided by a feeling of acceptance. God is merciful.
The other option is repentance. Some might say it is cowardly to turn to God when you are dying. I would say it is sensible. You can put all your intellectualising aside and just become what you always have been really which is a naked child. Become a naked child and turn to God and you will not be left comfortless. Choose light rather than darkness.