This is one of my favorite Bible verses. It encourages me to keep on going when things get dark and hard and tedious. Psalm 27:12 says "I had fainted, unless I had believed to see the goodness of the LORD in the land of the living."
Eyes that can see God's goodness when it is so very dark (the valley of the shadow of death) are eyes that have consistently sought God's face when it was not so dark. See Psalm 27:8 "When thou saidst , seek ye my face; My hearts said unto thee, thy face, O LORD, will I seek."