First of all, we would like to state that a Muslim is supposed to have unshakable belief in Allah. Whatever happens in this world is by Allah’s Divine Decree, and the fate of man is written on his forehead.
So with continuous and sincere supplication to Allah, a Muslim should feel sure that Allah Almighty will grant him children. Also, one should not lose hope in Allah’s Mercy as well as continuing in consulting specialized physicians for tests, medications and advice.
Below is a response given by Sheikh Ahmad Kutty, an Islamic scholar, on a question related this issue:
“You should turn to Allah imploring His mercy and grace. It is Allah and Allah alone Who grants offspring and decides when to give. However, this should not prevent you from consulting expert physicians to make sure that there are no physical complications. Any way, we must turn to Allah for His help, for it is ultimately in the Hands of Allah. You may recite the following du`a’ from the Qur’an on a regular basis:
“Rabbi la tadharni faradan wa anta khayru al-warithin
(My Lord! Leave me not solitary (childless though) You are the best of inheritors.)” (Al-Anbiya 89)
“Rabbi hab li min ladunka dhurriyyatan tayyibah innaka sami`ud du`a’ (My Lord! Grant me from You upright offspring, for You hear all prayers)” (Al `Imran 38)
Also, it will be a good for one before having intercourse with his wife to perform wudu’ and offer two rak`ahs of prayer (salatul hajah) and supplicate to Allah. On making love to his wife, a Muslim husband should say: “O Allah! Keep Satan away from us and keep him away from any offspring You may bless us with.” (Abu Dawud)
Remember, while offering supplications, it is important to cherish firm faith in Allah and faith that He will answer your prayer. The Prophet (peace and blessings be upon him) said, “Call upon Allah while believing firmly that your prayer is being answered.” (Sunan Al-Tirmidhi).
Also, be persistent in du`a’, and never give it up. For Allah will answer in His own time. Rest assured that du`a’ is always beneficial.”
Shedding more light on the issue of seeking offspring, Dr. Rif`at Fawzi, a professor of sharia stated the following:
“There is a verse in the Qur’an that answers the question; the verse is a du`a’ cited by Prophet Zachariah (Zakariyyah). Anyone who wants to have children should utter this du`a’ frequently. “And Zachariah, when he cried unto his Lord: My Lord! Leave me not solitary (childless though) You are the best of inheritors.” (Al-Anbiya’ 89)
When reciting the aforementioned supplication, the person should choose the times where du`a’ is usually answered by Allah, such as during the last third part of the night or at the time for adhan (call to prayer). In addition, the person should eat that which is lawful and run all his life affairs according to that which pleases Almighty Allah.
In his advice to his Companion Sa`d, the Prophet (peace and blessings be upon him) remarked: “O Sa`d! Eat that which is lawful to have your supplications answered.” (Al-Mu’jamul Awsat)