In Surah Ahqaaf, Allah Ta‘ala mentions a very profound and comprehensive du‘aa to be made when a person reaches the age of forty. The du‘aa is as follows:
رَبِّ أَوْزِعْنِيْ أَنْ أَشْكُرَ نِعْمَتَكَ الَّتِيْ أَنْعَمْتَ عَلَيَّ وَعَلٰى وَالِدَيَّ وَأَنْ أَعْمَلَ صَالِحًا تَرْضَاهُ وَأَصْلِحْ لِيْ فِيْ ذُرِّيَّتِيْ إِنِّيْ تُبْتُ إِلَيْكَ وَإِنِّيْ مِنَ الْمُسْلِمِيْنَ
“O my Rabb, enable me to become grateful for Your favour that You have bestowed on me and on my parents, and to do good deeds which You are pleased with, and make my progeny righteous for me. Indeed, I repent to you and I truly am from those who submit.” (Surah Ahqaaf v15)
According to some of the commentators of the Quraan Majeed, this du‘aa is actually the words with which Sayyiduna Abu Bakr (radhiyallahu ‘anhu) supplicated to Allah Ta‘ala when he reached the age of forty. Others say that this is not specifically referring to the du‘aa of Sayyiduna Abu Bakr (radhiyallahu ‘anhu). Rather, it is a general du‘aa which a person should make when he reaches forty, since when he reaches this age and realizes that he is advancing closer towards his end, his concern should be that a change should come in his life and his children’s life as well. Thus, he should be constantly making this du‘aa at this age.
This du‘aa is very similar to the du‘aa of Nabi Sulaimaan (‘alaihis salaam) (which can be found here). Like that du‘aa, the first and second portion comprises of seeking the ability to be grateful for the bounties of Allah Ta‘ala and the ability to carry out accepted actions respectively.
The third portion of this du‘aa, however, is different to that of Nabi Sulaimaan (‘alaihis salaam). Here, the supplication is that Allah Ta‘ala brings about goodness and piety in one’s progeny. This is an extremely important concern that every parent and grandparent must have. It was also the concern of the Ambiyaa (‘alaihimus salaam) as has been mentioned in various verses of the Quraan Majeed.
Once, Abu Ma’shar complained to Talhah bin Musarrif (rahimahullah) – the renowned Taabi‘ee and student of Sayyiduna Anas bin Maalik (radhiyallahu ‘anhu) – regarding his son. Talhah (rahimahullah) advised him to turn to Allah Ta‘ala and seek His special assistance for (the guidance of) his son by making the above mentioned du‘aa. (Hilyatul Awliyaa vol. 4, pg. 45)
Allah Ta‘ala accepted this du‘aa in relation to Sayyiduna Abu Bakr (radhiyallahu ‘anhu), as is evident from his life. Hence, Sayyiduna Abu Bakr (radhiyallahu ‘anhu) went on to free nine slaves who were being mercilessly persecuted by the disbelievers in Makkah Mukarramah at that time. Moreover, Allah Ta‘ala granted him the ability of carrying out many good deeds in his life.
Allah Ta‘ala also accepted the third portion of the du‘aa in his favour in such a manner that everyone in his family (i.e. his parents, and children) had accepted Islam, unlike many of the other Sahaabah (radhiyallahu ‘anhum).
(Extracted from Ma‘aariful Quraan vol. 7, pg. 807)