Nothing missing
Yahweh is my shepherd; I shall lack nothing.
David knew sheep. Before he was a king he was a shepherd boy, protecting a flock from lions and bears. So when he calls God his shepherd, he isn't reaching for a pretty picture. He is describing a job he knew was hard, dangerous and constant.
"I shall lack nothing" does not mean David always had everything he wanted. He spent years running for his life. It means that with this shepherd, nothing essential is missing. Guidance, protection, rest and presence are all provided.
Read the line slowly
Try reading the verse several times, leaning on a different word each time: Yahweh is my shepherd. Yahweh is my shepherd. Yahweh is my shepherd. Each emphasis opens something new: who he is, that it's true now, and that it's personal.