If an action is forbidden by law, the law says that you must not do it. It is a criminal offence. If you commit an act that is forbidden by law, you may be punished.