Shepherds in the region of Lebanon alone knew which of the many paths would lead the sheep safely out of the valley. Taking a wrong path could lead to peril, like a dead end where the sheep would become trapped and frightened or possibly off the edge of a cliff.
Now would be a good point to clear up a common misunderstanding about righteousness. Martin Luther once said of righteousness. “He who would gain righteousness by faith and works is as the dog who runs along a stream with a piece of meat in his mouth, and, deceived by the reflection of the meat in the water, opens his mouth to snap at it, and so loses both the meat and the reflection” (Martin Luther, Treatise on Christian Liberty) 
The proper understanding of righteousness is that Jesus invites us to imitate the “righteousness of God” who, out of Jesus’ righteousness, acts in history to save humanity. Jesus then says to us follow my example. Use Jesus’ righteousness as a model for our righteousness. Examine His life as the good shepherd with a trustworthy reputation. As one who acts out of his own integrity. A Savior who will not violate his core values and purpose even when tempted by Satan to give up that goal to save Himself. It would have been easy to say these people are not worthy, but not Jesus’s will but God’s divine purpose be done.
Even though I walk through the valley of the shadow of death,
Charles Schultz, the creator of the comic strip “Peanuts,” pictures one of his characters, Linus, tenaciously clinging to his security blanket. Wherever he goes or whatever he does, Linus must have his blanket. He feels insecure without it. This quote may be humorous, but actually, all of us have to have our security blankets of one kind or another. 
This section of Psalm 23 always gave me a reason to pause and just sit here in the valley for a moment, particularly in the head of a casket. The Valleys of the shadow of death being referenced here are paths which wind in between mountains where there are dark shadows and deep gorges. Travelers march carefully, slowly and silently through this valley wondering if this may be their last trip. Will some form of evil befall them here? It was a known hideout for bandits.
The fear of death was very real. And because it was possible that at some point during this long slow walk death was constantly on their minds. What would you do at that moment? Sing hymns to comfort your troubled soul? Recite your favorite scripture verse? Maybe you would just repeat the words of this Psalm, “Even though I walk through the valley of the shadow of death, I will fear no evil for you are with me;”
There was no other road to travel. No magical escape like using your communication device and asking Scotty to transport you back to the Starship Enterprise. The only way forward in this life is through the valley of sin and death. We all must make this journey through the valley at some point in our lives. When that day comes how will you navigate your way through the valley? Where will you find the comfort? What will give you the necessary strength to endure? What gives us comfort is the same thing comforted psalmist. The psalmist knew and Christians today know that our journey does not end there in the valley of death. It is a passageway to the place Jesus prepared for us with His very own hands. Here what our Savior said in John 10: “All who came before me are thieves and robbers, but the sheep did not listen to them. I am the door. If anyone enters by me, he will be saved and will go in and out and find pasture.” John 10:8–9.
Even though we have this promise, we still must deal with the fear the valley can generate. Fear of death cripples us on this journey of life. Take comfort in this the valley cannot destroy us.
As Paul reminds us in 1 Corinthians 15: “The last enemy to be destroyed is death. For “God has put all things in subjection under his feet.”
Behold! I tell you a mystery. We shall not all sleep, but we shall all be changed, in a moment, in the twinkling of an eye, at the last trumpet. For the trumpet will sound, and the dead will be raised imperishable, and we shall be changed. For this perishable body must put on the imperishable, and this mortal body must put on immortality. When the perishable puts on the imperishable, and the mortal puts on immortality, then shall come to pass the saying that is written:
“Death is swallowed up in victory.”
“O death, where is your victory?
O death, where is your sting?”
The sting of death is sin, and the power of sin is the law. But thanks be to God, who gives us the victory through our Lord Jesus Christ.”
Like Linus, I need to find that security, but If my deepest sense of security is in the efficiency man made promises of protection then when those things stumble, my fears can quickly engulf my joy. But if the Lord is my good shepherd, I can stand firm in the midst of the valley of the shadow of death because I know the shepherd will lead me through the valley. The shepherd’s promise is all the security I need. Jesus’ said, “I am the good shepherd. I know my own, and my own know me, just as the Father knows me, and I know the Father, and I lay down my life for the sheep. John 10:14–15
 [Philadelphia: Fortress, 1943]). Green, M. P. (Ed.). (1989). Illustrations for Biblical Preaching: Over 1500 sermon illustrations arranged by topic and indexed exhaustively (Revised edition of: The expositor’s illustration file). Grand Rapids: Baker Book House.
 Tan, P. L. (1996). Encyclopedia of 7700 Illustrations: Signs of the Times (p. 1192). Garland, TX: Bible Communications, Inc.
Other posts on Psalm 23.