The earlier discussion of the social contract and the sovereign explain how the body politic comes into being; the question of how it maintains itself calls for a discussion of law. Rousseau suggests that there is a universal and natural justice that comes to us from God, but that it is not binding. Evil people will not obey God's law, and so we must set up positive, binding laws within society, or else those who obey God's law will suffer at the hands of those who disobey it.
Rousseau defines law as an abstract expression of the general will that is universally applicable. All laws are made by the people as a whole and apply to the people as a whole: the law does not deal with particularities. The law can never deal with individual people or groups, so while it can say that a certain group should have certain privileges or that a certain person should be the head of state, it cannot determine which particular individual or group should receive these privileges.
The law is essentially a record of what the people collectively desire. A law can only be enacted if the people collectively agree on it, and it must apply to all of them. A declaration of the sovereign that applies only to certain people or certain objects is not a law, but a decree.
The existence of civil society hinges on the existence of laws. However, Rousseau acknowledges the problem of how laws should be laid down. How can a people as a whole sit down together and write up a code of law? There is not only the problem of how such a large number could write up such a document together, but also the problem that the people do not always know what they want or what is best for them. Rousseau's proposed solution comes in the form of a lawgiver.
An ideal lawgiver is not easy to find. He must be supremely intelligent, and willing to work selflessly on behalf of a people. Because the laws shape the character and behavior of the people to a great extent, the lawgiver must exhibit great insight. In order for the laws to be unbiased, the lawgiver should not himself be a citizen of the state to which he gives laws. He is outside and above the authority of the sovereign. Remarking on the difficulty of finding such a person, Rousseau notes: "Gods would be needed to give men laws."
Not only is there the difficulty of finding a lawmaker of genius who does not himself wish to govern; there is also the difficulty of making the people obey the laws. People are unlikely to simply accept the laws given to them by a particular person. Rousseau notes that throughout history, lawgivers have used the authority of God or some other divine power to support them. Moses, for instance, claims that God gave him the Ten Commandments. An appeal to the supernatural origins of the laws is generally a good means of ensuring that they are obeyed.
When people aren't abiding the general will and they are "forced to be free", this wasn't advocating totalitarianism. The general will is laws that are accepted as just and those who don't follow the general will are breaking the law. Rousseau is advocating to force people to follow the law because it is in everyone's best interest to do so.