The word "heart" represents the person emphasizing their thoughts and feelings. Alternate translation: "I was very sad" (See: [[rc://en/ta/man/translate/figs-synecdoche]])
The psalmist speaks of emotional pain as if it were physical pain by being pierced with a knife or arrow. Alternate translation: "I felt like someone had wounded me" (See: [[rc://en/ta/man/translate/figs-metaphor]])