At the time that the Constitutional Convention adopted the US Constitution the original draft was found to be unacceptable to a sufficient number of delegates that it would not pass, hence the Bill of Rights was added to overcome the concerns of those delegates.
At the same time there was no such thing as local or state police forces, or the National Guard. The militia was understood to mean the entire population equipped with their own arms.
The militia of the United States is effectively created within the US Constitution, consisting of all able-bodied men within a certain age group.
The Militia Act, contained in the United States Code, implements the militia and governs its uses and command structure. Periodically changed and updated over the years, the Militia Act now defines the Militia of the United States to consist of all able-bodied males between 18 and 45 years of age. The Militia Act serves as the statutory authority under which the Selective Service Act has operated for generations, and all legal male residents of the US are required by law to register under the Selective Service Act and are subject to induction in accordance with the provisions of that Act.
Our Constitution has also been amended to include prohibitions on discrimination based upon age and gender. This has effectively expanded membership in the militia to all adult citizens and legal residents.
Each state has full legal authority to establish and maintain a state militia, and all have done so. The laws creating the National Guard during the early part of the 20th Century served to codify and regulate the state and national militia(s) and regulate command and control (in service to the state under command of the governor until such time as "federalized" by order of the president and/or authorized by act of Congress).
The argument over the use of the word "militia" in the Second Amendment is one of the easiest arguments to overcome, simply by reference to the full text of the Constitution as well as current and past iterations of the Militia Act and Selective Service Act. There can be no question that all adult citizens and legal residents are, in fact, the Militia of the United States.
The use of the words "well regulated" must be parsed in the original meaning at the time this amendment was drafted, which was to the effect that the militia was properly organized, commanded, disciplined and trained to perform its duties. These responsibilities are primarily on the several states, and secondarily on the federal government, not on individual militia members. Failure of the government to effectively organize, command, train, or discipline the popular militia (or even to acknowledge its existence) has been the fault of elected and appointed government officials.
In any serious and objective examination of Constitutional issues some of the primary sources include the Federalist Papers (circulated during the Constitutional Convention arguing in favor of adopting the proposed Constitution and federal government) and the Anti-Federalist Papers (circulated in opposition to adoption of the Constitution and proposed federal form of government). In both of these sources are many writings reflecting the leading minds of the time. Taken as a whole, it is clear that the Founders recognized the militia as consisting of three categories of service; (1) the "popular militia", consisting of the whole body of the people, armed; (2) the "select militia", those having been specifically called into active militia service (state armed forces, local and state law enforcement agencies); and (3) the military forces of the United States under command of the president pursuant to laws passed by the congress.
The entire "well regulated militia" argument is a red herring thrown out by those who fail or refuse to accept the entire concept of government of the people, by the people, and for the people. Some choose to view things with government as a group ruling the people, rather than the obvious and clearly stated commitment of the Founders for a government serving the people at the peoples' will and pleasure.
The entire concept, and the true genius behind our Constitution, is one of a government limited by having only those powers and authority delegated to it by the people. My argument is that the people possess all powers and authority, and the government cannot possess any power or authority that the citizens do not have to delegate; and further, that the act of delegation does not relieve the citizens of those powers and authority. In short, if the people do not have the right to keep and bear arms then the government authority to keep and bear arms on behalf of the people cannot exist.
The Constitution serves as the social contract binding the several states and all citizens together under one national government. When the Constitution is violated by the national government neither the several states nor individual citizens are bound by that contract; i.e.: the national government has no legal basis on which to do anything, and operates solely as a tyranny.