Law is a set of rules which forms a framework to ensure a peaceful society. These are enforced by the state and, if they are broken, sanctions can be imposed. Those who have control over the law can decide what is right and wrong, and it is possible to make laws that are binding on everyone in a nation-state.
Law may be made by collective or single legislators, resulting in statutes, or it may be decided through the executive branch via decrees and regulations, or through judicial decisions and precedent, which is the case with common law jurisdictions. Individuals can also create legally-binding contracts, such as those that are enforceable in court. It is important to note that law is a very complex topic from a methodological standpoint, because it involves normative statements which are deprived of the descriptive and causal character found in empirical sciences (such as the law of gravity) or social science (such as the law of supply and demand).
Some laws are explicitly based on religious precepts, such as Jewish Halakha, Islamic Sharia, and Christian canon law; others require human elaboration, such as Qiyas, Ijma, and jurisprudence (reasoning by analogy, consensus, and precedent). It is possible for a person to take the law into their own hands, meaning to administer justice as they see fit without recourse to normal legal processes. It is also possible for a person to be judged and punished by the law, as is the case with criminal cases.