Amy Coney Barrett and the Second Amendment: Why her "expansive view" is utter BS
That might be a bit dizzying, but given that Barrett was an English literature major and is a textualist, her imperative to avoid misinterpretation here would seem like a piece of cake.
To me (and to many others, including a number of Supreme Court justices), the obvious sense here is "In that a well-regulated Militia is necessary to the security of a free State, the right of the people to keep and bear arms shall not be infringed." The latter thing, the right, is contingent on the former thing, the well-regulated militia and the need for such.
The original Congress that passed the Bill of Rights might have chosen to turn it around, as in "The right of the people to keep and bear Arms shall not be infringed because a well-regulated Militia is necessary to the security of a free State" (and it was in that order in an original draft by Madison), but they chose to emphasize the "well-regulated Militia being necessary" clause, which in effect makes it a conditional clause — if this is true, then this other thing follows.