Jesus said that he was the Good Shepherd and would die for his people:
Jesus said, ‘I am like the good shepherd. The good shepherd is ready to die on behalf of his sheep. A worker who receives wages to look after the sheep is not like the shepherd. That worker does not own the sheep. So if he sees a wolf (wild dog), he will leave the sheep. He will run away. Then the wolf will attack the sheep. And the sheep will scatter. This is because such a worker only cares about his wages. He does not really care about the sheep.
I describe myself as the good shepherd. I know my sheep (my people) and my sheep know me. This is like my relationship with the Father. The Father knows me, and I know the Father. And I am ready to die on behalf of the sheep. I have other sheep, too. They belong to me, but they are not in this sheepfold. I must bring them also, and they will listen to my voice. Then there will be one flock (group of sheep) with one shepherd.
The Father loves me because I give my
life. But I will receive my life back again. Nobody takes my life from
me. I give my life because I want to give it. I have the authority both
to give my life and to receive it back again. My Father has ordered me
to do this.’
John 10v11-18
King David talked about how God looked
after his people like a shepherd — see his most famous poem Psalm 23.