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. AT: "I will enable them to obey my laws" (See: [[rc://en/ta/man/translate/figs-metonymy]] and [[rc://en/ta/man/translate/figs-metaphor]])
# I will write them on their minds
This is a metaphor for causing people to understand the law. AT: "I will enable them to understand my laws" (See: [[rc://en/ta/man/translate/figs-metaphor]])