Here the words "pay attention to" are a metonym for the way that David will live because he has paid attention to the way of integrity. Alternate translation: "I will live in a way that is honest and right" or "I will live a life full of integrity" (See: [[rc://en/ta/man/jit/figs-metonymy]] and [[rc://en/ta/man/jit/figs-metaphor]])
Here David speaks about living as if it were "walking." The word "heart" here is a metonym for the way he thinks and feels. Alternate translation: "I will live in my house with integrity" (See: [[rc://en/ta/man/jit/figs-metaphor]] and [[rc://en/ta/man/jit/figs-metonymy]])