The US legal system is based on federal law, augmented by laws enacted by state legislatures and local laws passed by counties and cities. Most rights and freedoms enjoyed by Americans are enshrined in the first ten amendments of the US Constitution and popularly known as the ‘Bill of Rights’.
American law and the US Constitution apply to everyone in the US, irrespective of citizenship or immigration status, and even illegal immigrants have most of the same basic legal rights as US citizens. Under the US constitution, each state has the power to establish its own system of criminal and civil laws, resulting in 50 different state legal systems, each supported by its own laws, prisons, police forces, and county and city courts. There’s a wide variation in state and local laws, making life difficult for people moving between states. Never assume that the law is the same in different states (Conflict of State Laws is a popular course in American law schools).