Praying with a Minyan
One should make an effort to pray in shul together with the congregation. If, however, due to circumstances beyond his control, one is unable to pray with the congregation, he should at least pray at the same time that they pray. If it is not possible for him to pray at the same time as them, and he is praying alone, then it is better to pray in shul. Rema: The same rule applies to people who live in a place without a minyan; therefore, they should pray Shacharit and Ma’ariv when the congregation prays. (Shulchan Aruch Orach Chaim 90:9)
Though the prayers of an individual are not guaranteed to be accepted, the prayers of the congregation are never rejected, and one should therefore pray with the congregation even if there are sinners among them. It is better to pray with a minyan in shul than to pray with a minyan at home. If one has a choice to pray between two shuls, he should go to the one with more people. This is because there is greater honor accorded to
The Mishneh Berurah explains what is considered grounds for not being able to pray with the congregation as follows: 1) One who is too weak to go to shul, even though he is not actually sick. 2) If one will suffer an actual monetary loss by going to pray with the congregation, he is allowed to pray by himself at home or in the shul.
However, one should not refrain from praying with the minyan if he only stands to lose profit. For one cannot compare losing profit to losing one’s own money. The Mishneh Berurah writes a story of a great rabbi who passed up a chance to earn a large profit because it would interfere with praying with a minyan. Afterwards, when he found out how much profit he actually lost, he was happy that he did not let money interfere with his prayers. The Eliyah Rabba writes in the name of Teshuvot Beit Yosef that a fine should be imposed on those who do not go and pray with a minyan because they are learning or doing business instead.