Law puts structure into our chaotic world. It is a complete necessity in order to create a functional society, without it, everything would be total havoc. It’s a set of rules that apply to everyone, but I think that law does limit our freedom.
By definition, law literally constrains us and doesn’t allow us to do something we would otherwise be able to do. If somebody were to live in a place with no laws, they would have more freedom of will than somebody living in a large city full of laws to follow. But the difference is that the first person would not be able to reap the benefits of living in harmony with other people in a massive system. That’s the sacrifice you have to question if it’s worth taking. Someone living in a city full of laws would be able to find a job, earn a living, gain a purpose, be motivated to work. Therefore, in a kind of way, they can do more than someone just living with no laws, completely purposeless.
Of course, the law isn’t perfect. It is not 100% just and not everybody follows it. It greatly varies around the world, oppressing certain groups, and everybody didn’t agree to follow all of the laws made in the past. Hypothetically, if we had the ability to create a new society from scratch with our current knowledge and resources, I believe we would be able to make it a lot fairer for everyone, as the Social Contract theory, where each and every individual would agree to participate in it, and decisions can only be made if all support it as all are respected equally. This would be ideal, but as of now, that’s not how it works.
Freedom is an interesting concept, I think if something is free it is not constrained, able to move however it wants whenever it wants, or in a sense able to do more physical things than something that is constrained. Law does limit our freedom, if there were no laws, we would be able to do anything we wanted. But by willingly giving up some of our freedom, we can live in relative peace, which I would say actually gives us more freedom as we are able to pursue our interests rather than just focusing on surviving.