The writer describes a person experiencing terrible trouble as if he were a sheep walking through a dark and dangerous valley. There a sheep could get lost or attacked by a wild animal. Alternate translation: "Though my life is like walking through a dark and dangerous valley" (See: [[rc://en/ta/man/translate/figs-metaphor]])
The abstract noun "harm" can be stated as a verb. Alternate translation: "I will not be afraid of something harming me" (See: [[rc://en/ta/man/translate/figs-abstractnouns]])
The rod and staff represent protection because shepherds use them to protect their sheep from danger. Alternate translation: "I am not afraid because you protect me like a shepherd who protects his sheep with his rod and staff" (See: [[rc://en/ta/man/translate/figs-metonymy]])