Praise be to Allah.
Will good deeds be accepted from those who do not pray?
No good deeds will be accepted from one who does not pray – no zakah, no fasting, no Hajj or anything else.
Al-Bukhari (520) narrated that Buraydah said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever does not pray ‘Asr, his good deeds will be annulled.”
What is meant by “his good deeds will be annulled” is that they will be rendered invalid and will be of no benefit to him. This hadith indicates that Allah will not accept any good deed from one who does not pray, so the one who does not pray will not benefit at all from his good deeds and no good deed of his will be taken up to Allah.
It seems from the hadith that there are two types of those who do not pray: those who do not pray at all, which annuls all their good deeds, and those who do not offer a particular prayer on a particular day, which annuls the good deeds of that day. So annulment of all good deeds happens to those who forsake all the prayers, and annulment of the good deeds of a particular day happens to the one who omits a particular prayer.
Does your fast count if you don't pray?
Shaykh Ibn ‘Uthaymin was asked in Fatawa al-Siyam (p. 87) about the ruling on the fasting of one who does not pray.
“The fast of one who does not pray is not valid and is not accepted, because the one who does not pray is a disbeliever and an apostate . Allah says (interpretation of the meaning):
“But if they repent [by rejecting Shirk (polytheism) and accept Islamic Monotheism], perform As-Salah (Iqamat-as-Salah) and give Zakah, then they are your brethren in religion.” [al-Tawbah 9:11]
And the Prophet (peace and blessings of Allah be upon him) said: “Between a man and shirk and disbelief stands his giving up prayer.” (Narrated by Muslim, 82) And he (peace and blessings of Allah be upon him) said: “The covenant that separates us from them is prayer; whoever gives up prayer is a disbeliever.” (Narrated by al-Tirmidhi, 2621; classed as sahih by al-Albani in Sahih al-Tirmidhi)
This is also the view of most of the Companions, if not their consensus. ‘Abd-Allah ibn Shaqiq (may Allah have mercy on him), who was one of the well-known Tabi’in, said: The Companions of the Prophet (peace and blessings of Allah be upon him) did not think that omitting any action made a person a disbeliever, except for prayer. Based on this, if a person fasts but he does not pray, then his fast is rejected and not accepted, and it will not avail him anything before Allah on the Day of Resurrection. We say to him: Pray then fast, because if you fast but do not pray, then your fast will be rejected, because acts of worship are not accepted from a disbeliever.”
The Standing Committee (10/140) was asked: if a person is keen to fast in Ramadan and to pray in Ramadan only, but he stops praying as soon as Ramadan is over, does his fasting count?
“Prayer is one of the pillars of Islam , and it is the most important pillar after the Shahadatayn. It is an individual obligation (fard ‘ayn), and whoever does not do it because he denies that it is obligatory, or he does not do it because he is careless and lazy, is a disbeliever. With regard to those who fast Ramadan and pray in Ramadan only, this is trying to cheat Allah, and unfortunate indeed are those who only acknowledge Allah in Ramadan. Their fasting is not valid if they do not pray at times other than Ramadan, rather this makes them disbelievers in the sense of major kufr (kufr akbar), even if they do not deny that prayer is obligatory, according to the more sound of the two scholarly opinions.”
And Allah knows best.