When you are building a world from scratch, there is so much to think about. So many tiny details you need to add, that some get over-looked. This is why it is a good idea to keep notes and note cards.
One thing that always seems to be taken for granted is laws. It is only hinted at in most fantasy worlds. What is right from wrong, what are the punishments? What is acceptable in society?
While there are some givens, like no stealing, no killing, don't cheat on your spouse kind of things, there are times when details will need to be called upon. Again, the depth you want to go with these details is entirely up to you and the story you are writing. You don't want to get into a lot of these details about laws if you are not writing about a thief.
But there are all sorts of laws that this topic covers when writing fantasy. Laws of earth and men, laws of magic. Laws for gods and goddesses. Well, those are mostly rules, but lots of them have consequences when broken.
Fizanu is my goddess of Law and Justice. Her disciples are scriveners of law. She dictates the laws to her priests and priestesses and they write them down. These are then passed on to the Law Makers of Fizanu. There is at least one Law Maker in every major city and town as well as an Overseer. The Overseer is the equivalent to a sheriff.
So if we were to follow the order of my laws, they start with Fizanu, then are given to the Law Makers, who pass it on to the Overseer who in turn passes it on to the King or Queen.
Punishments for crimes are pretty straightforward. There are dungeons, jail cells and (for those really nasty criminals) an island. On this island are colonies formed from the nature of the offense. Murderers inhabit one colony, repeat offenders of theft inhabit another and so on.
So think about your laws. What would you consider a crime? What would punishment consist of? Would you chop off the hand of a thief? Behead a killer?