This is the 1767th most frequent Russian word.
закону
"Закону" is the dative case of "закон," meaning "to the law" or "for the law" in English.
The word 'закону' is used in its dative case form, where it indicates the entity towards which the action of following is directed.
Мы должны следовать закону.
We must follow the law.
Here, 'закону' appears in the dative case to denote that the actions are being compared against the law, expressing contradiction.
Его действия противоречили закону.
His actions contradicted the law.
The dative case 'закону' is employed to show the purpose or standard of compliance in the sentence.