Every human is aware of the inevitable nature of death; yet people don't feel as terrified of death as expected even at old age. What mechanism reduces this terror ?
"One theory that explains this is terror management theory"
According to this theory, it is the culture that prevents this fear. People either keep themselves unaware of this reality or those who are aware of it most of the time ; they would be pursuing their cultural goals. In this way they would also be increasing their self esteem. These two (high self esteem, and cultural world view being defended, reduce the fear or anxiety of the inevitability of death.
For example, Muslims would become more religious in old age and that would also elevate their self esteem and give a purpose to their lives so their death related anxiety would reduce . I think, if i am not wrong, there is a Hadith related to this as well, that we should remind ourselves about death every now and then "remind often the destroyers of pleasures"death [sunan at Tirmhdi]. wherever you are, death will find you, even if you are in towers built-up strong and high" Quran [4:78] (someone correct me). Which according to this theory would make people more religious (if they are).