Today’s daf (Pesachim 46a) tells us about the (literal) lengths that one should go to in order to perform a mitzvah: ‘Rabbi Abahu said in the name of Rabbi Shimon Ben Lakish: “With regard to a kneader (who kneads dough for others but who needs to immerse their utensils before doing so), or with regard to (someone who is in a location where there is no minyan for) prayer, or with regard to (the mitzvah of) washing hands (where there is no water for a person to do so where they are currently located), then the person should travel up to ‘4 mil’ (approx. 4 km) to fulfil these mitzvot”’.
What this seemingly means is that if someone is within ‘4 mil’ of a location where they can immerse their utensils, or where they can pray with a minyan, or where they can wash their hands, they must then make that journey to do so. Significantly, this is precisely how many halachists such as Rabbi Moshe Feinstein (1895-1986) understand this statement (see Responsa Iggrot Moshe OC 2 27), and thus he rules that it is obligatory for someone to travel in order to pray with a minyan.
However, it is essential that we understand individual rabbinic teachings in the context of other rabbinic laws and teachings, and as Rabbi Yosef Eliyahu Henkin (1881-1973) – who was the leading halachic decisor in America before Rabbi Feinstein arrived – explains (see Responsa Gevurot Eliyahu 1:24.2), though there is a duty for communities wherever possible (i.e. not including during a global pandemic) to have minyanim operating thrice daily, this does not mean that every Jew is dutibound to attend tefillah with a minyan. Instead, as he explains on the basis of other Gemarot (eg. Brachot 7b) is that if such a person is located where a minyan has gathered together to pray, they should join in. However, if they are not, then they are not dutibound to travel in order to do so.
And what does Rabbi Henkin make of the statement found in our Gemara? He suggests that perhaps it expresses a ‘hiddur mitzvah’ (i.e. acting beyond the basic halachic requirement), or alternatively, it is speaking of a case where a person doesn’t know how to pray, in which case such a person must attend a synagogue in order to listen to the chazan pray out loud, to respond ‘Amen’, and thus fulfil their duty of praying (nb. using this explanation coupled with further halachic arguments, Rabbi Henkin, in Responsa Gevurot Eliyahu 1:12.2, presents a halachic justification – or as they say, he is ‘melamed zechut’ – for why many people who don’t even know Shema and don’t know how to pray also don’t attend daily prayers in shul).
What we see from here is that one posek (R’ Feinstein) interprets this Gemara alongside other halachic statements to speak of minyan as an absolute requirement (i.e. requiring heroic efforts or significant self-sacrifice to do so but, again, not including doing so when this may cause danger to life eg. during a global pandemic), while another posek (R’ Henkin) does the same while concluding that minyan is something that someone should endeavour to fulfil, but that this mitzvah does not demand heroic efforts or significant self-sacrifice (nb. aside from a variety of sources I could provide to support this position, the footnotes of Responsa Gevurot Eliyahu 1 p. 44 note 77 cite the Minhagei Maharil Hilchot Eiruvei Chazeirot No. 7, as also quoted by the Chavat Yair and Rabbi Akiva Eiger, which says precisely this and which concludes by reminding us that “a person can also have kavanah in their prayers when praying at home”).