From ‘Two Treatises on Government’ Chapter 7.Locke is setting out his theory as to the relationship between the individual and the state.The theme of Life and Liberty is taken up in the Declaration of Independence.

Section  87.

Man being born, as has been proved, with a title to perfect freedom, and an uncontrouled enjoyment of all the rights and privileges of the law of nature, equally with any other man, or number of men in the world, hath by nature a power, not only to preserve his property, that is, his life, liberty and estate, against the injuries and attempts of other men; but to judge of, and punish the breaches of that law in others, as he is persuaded the offence deserves, even with death itself, in crimes where the heinousness of the fact, in his opinion, requires it.

But because no political society can be, nor subsist, without having in itself the power to preserve the property, and in order thereunto, punish the offences of all those of that society; there, and there only is political society, where every one of the members hath quitted this natural power, resigned it up into the hands of the community in all cases that exclude him not from appealing for protection to the law established by it.

And thus all private judgment of every particular member being excluded, the community comes to be umpire, by settled standing rules, indifferent, and the same to all parties; and by men having authority from the community, for the execution of those rules, decides all the differences that may happen between any members of that society concerning any matter of right; and punishes those offences which any member hath committed against the society, with such penalties as the law has established: whereby it is easy to discern, who are, and who are not, in political society together.

Those who are united into one body, and have a common established law and judicature to appeal to, with authority to decide controversies between them, and punish offenders, are in civil society one with another: but those who have no such common appeal, I mean on earth, are still in the state of nature, each being, where there is no other, judge for himself, and executioner; which is, as I have before shewed it, the perfect state of nature.

Section 88.
And thus the common-wealth comes by a power to set down what punishment shall belong to the several transgressions which they think worthy of it, committed amongst the members of that society, (which is the power of making laws) as well as it has the power to punish any injury done unto any of its members, by any one that is not of it, (which is the power of war and peace;) and all this for the preservation of the property of all the members of that society, as far as is possible.

But though every man who has entered into civil society, and is become a member of any commonwealth, has thereby quitted his power to punish offences, against the law of nature, in prosecution of his own private judgment, yet with the judgment of offences, which he has given up to the legislative in all cases, where he can appeal to the magistrate, he has given a right to the common-wealth to employ his force, for the execution of the judgments of the common-wealth, whenever he shall be called to it; which indeed are his own judgments, they being made by himself, or his representative.

And herein we have the original of the legislative and executive power of civil society, which is to judge by standing laws, how far offences are to be punished, when committed within the common-wealth; and also to determine, by occasional judgments founded on the present circumstances of the fact, how far injuries from without are to be vindicated; and in both these to employ all the force of all the members, when there shall be need.

Section 89. Where-ever therefore any number of men are so united into one society, as to quit every one his executive power of the law of nature, and to resign it to the public, there and there only is a political, or civil society.

And this is done, where-ever any number of men, in the state of nature, enter into society to make one people, one body politic, under one supreme government; or else when any one joins himself to, and incorporates with any government already made: for hereby he authorizes the society, or which is all one, the legislative thereof, to make laws for him, as the public good of the society shall require; to the execution whereof, his own assistance (as to his own decrees) is due.

And this puts men out of a state of nature into that of a common-wealth, by setting up a judge on earth, with authority to determine all the controversies, and redress the injuries that may happen to any member of the commonwealth; which judge is the legislative, or magistrates appointed by it. And where-ever there are any number of men, however associated, that have no such decisive power to appeal to, there they are still in the state of nature.

[Paragraphing added for ease of reading].