Psalms 23 is one of the most famous Psalms in our canon, and one most believers have memorized, sometimes even as children.
Psalm 23:1 (NLT) 1 The Lord is my shepherd; I have all that I need.
God is the Shepherd, and we are the sheep and this relationship is intimate and personal.
David is not praying in this Psalm, he is not asking God to do something for him. Rather he is rejoicing in what the Lord has done and continues to do in his life.
David was confident that God, the Good Shepherd would provide for his needs.