A. The Midrash Shocher Tov (paralleled in other sources) says on Psalm 1, “Pray in the synagogue in your city; if this is impossible, pray in the field. If that is impossible, pray in your house; if necessary, pray in your bed. Should this be impossible, pray in your heart wherever you may be.”
One might add that there are two ways to pray – in your words, and in your deeds. Living a righteous life is also a form of worship.