The decision in District of Columbia v. Heller, 554 U.S. 570 (2008), was written by Justice Antonin Scalia. Scalia later co-authored (with Bryan A. Garner) a book entitled Reading Law: The Interpretation of Legal Texts. The text of the decision is of course a basic source on the Second Amendment. Scalia also writes about the case in his book, where he is describing how an originalist (which is what he called his legal philosophy) approaches law, which goes, he says, beyond the historical usage of words:
For example, in the Heller case, which upheld the individual right to
possess firearms, one of the significant aspects of the Second
Amendment was that it did not purport to confer a right to keep and
bear arms. It did not say that "the people shall have the right to
keep and bear arms," or even that "the government shall not prevent
the people from keeping and bearing arms," but rather that "the right
of the people to keep and bear arms" (implying a preexisting right)
shall not be infringed." This triggered historical inquiry showing
that the right to have arms for personal use (including self-defense)
was regarded at the time of framing as one of the fundamental rights
of Englishmen. Once the history was understood, it was difficult to
regard the guarantee of the Second Amendment as no more than a
guarantee to of the right to join a militia. Moreover, the prefatory
clause of the Second Amendment ("A well regulated militia being
necessary for the defense of a free state") could not be logically
reconciled with a personal right to keep and bear arms without the
historical knowledge (possessed by the framing generation) that the
Stuart kings had destroyed the people's militia by disarming those
whom they disfavored. Here the opinion was dealing with history in a
broad sense.
Because questions about the Second Amendment appear on EL&U from time to time, I thought it would be worthwhile to provide this background, which is essentially the late Justice Scalia's answer to the question.