Here "hearts" is a metonym for a person's inner being. The phrase "put them in their hearts" is a metaphor for enabling people to obey the law. Alternate translation: "I will enable them to obey my laws" (See: [[rc://en/ta/man/translate/figs-metonymy]] and [[rc://en/ta/man/translate/figs-metaphor]])