In Japan a long time ago, during a time called the Edo period, if somebody did something that was against the law or government rules, they would get punished. There were a few different types of punishments, and each one was used for different types of crimes.
One way they punished people was by putting them in jail. Jail was a small room with no light where people would be locked in for a certain amount of time to think about what they did wrong. If the crime was more serious, like stealing or hurting somebody, the person would be put in a bigger room with other people who were also in trouble.
Another way people were punished was by being publicly shamed. This meant that everybody in the town would find out what the person did wrong, and they would have to stand in a busy area while people yelled at them or threw things at them. This was to make sure that other people knew not to do the same thing.
For more serious crimes, like murder, the punishment was much more severe. The person would be sentenced to death, which meant they would be killed. There were a few different ways this could happen, but the most common was by beheading. The condemned person would be brought to a special area, where a skilled swordsman would cut off their head with one strike.
In Japan during the Edo period, the government was very strict about following their rules, so people thought very carefully before doing anything that could get them in trouble. That's why it was important for everyone to know what would happen if they broke the law.