All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
If a calamity befalls a Muslim it is not necessarily because of a sin that he did, and it could merely be a test from Allaah. If he is patient with this calamity, then the outcome is that his sins will be forgiven and his status raised. For more benefit, please refer to Fatwa 83577.
There is no doubt that performing acts of good deeds is a reason for having children. Therefore, we advise you to continue performing these acts which you were performing, and you should earnestly supplicate Allaah and consult specialist and experienced doctors. Furthermore, you should not forget to perform Ruqyah as it is beneficial, Allaah willing.
After this, if it is a necessity to resort to permissible ways of in-vitro fertilization, then this is permissible. For more benefit in this regard, please refer to Fatwa 82554. You may also refer to Fatwa 86757 which is entitled "Du’aa’ for successful childbearing”.
Finally, we advise you to be kind to your family, and advise those who do not pray or fast and who commit prohibitions and offer your advice in a good manner and a soft way, while supplicating Allaah to guide them.
Allaah Knows best.