Having children or not is a matter of Divine Decree
Q:
What is the ruling on a woman who is worried about not getting pregnant? She sometimes resorts to crying and thinking too much to the extent that she renounces worldly life. What is your advice to her?
A:
This woman should neither feel worried nor cry about not becoming pregnant. The natural tendency of men and women to give birth to boys only or to girls only or to both sexes, and also the possibility that they might not give birth to children at all, which are all dependant on Allah's Will (Glorified and Exalted be He). Allah (Exalted be He) says:
To Allâh belongs the kingdom of the heavens and the earth. He creates what He wills. He bestows female (offspring) upon whom He wills, and bestows male (offspring) upon whom He wills.
Or He bestows both males and females, and He renders barren whom He wills. Verily, He is the All-Knower and is Able to do all things.
Allah (Glorified and Exalted be He) is All-Knowledgeable about what everyone deserves to have of offspring and is All-Able to give and withhold and vary our destinies as He wills. This woman should follow the good example of Prophets Yahya ibn Zakariyya (John, son of Zachariah, peace be upon them) and `Isa ibn Maryam (Jesus, son of Mary, peace be upon them), who both had no children. Hence, she should be content with Allah's Decree and beseech Him to fulfill her wish. Indeed, Allah is All-Wise and Almighty.There is no harm if she visits female doctors or male ones in case there are no female doctors. They may find a treatment if she has some symptoms preventing pregnancy. (Part No. 3; Page No. 531) Likewise, her husband should visit a doctor because he may be the reason for this delay of pregnancy.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.