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.
Wenn eine Handlung gesetzlich verboten ist, sagt das Gesetz, dass man diese Sache nicht tun darf. Es handelt sich um eine strafbare Handlung. Wenn Sie eine Handlung begehen, die gesetzlich verboten ist, können Sie bestraft werden.