To engrave something in one's heart/mind; to remember something deeply so as not to forget it (often a lesson, advice, or promise).
祖母の言葉を心に刻んで、困ったときに思い出している。
I have my grandmother's words engraved in my heart and recall them when I'm troubled.
あの事故の教訓を心に刻み、二度と同じミスをしないと誓った。
I engraved the lesson of that accident in my mind and vowed never to make the same mistake again.
先生の注意を心に刻み、次回はもっと注意深く取り組むつもりだ。
I took the teacher's warning to heart and will approach it more carefully next time.