In the Gospel of John Chapter 10 Jesus says several times "I am the gate".
In Chapter 10 - 9 He says "I am the gate. Those who come in by me will be saved; they will come in and go out and find pasture."
This seems strange at first. We can understand when Jesus says "I am the Way" or "I am the Good Shepherd"; but gate? What does all that mean?
To understand this we need to visualise how a sheep pen at the times of Christ looked like. It was a circular or square enclosure built out of stone, wooden fencing or just hedges. And it had an opening through which sheep got in and out.
But shepherds in those days were poor people. They certainly would not have the money to build gates at the opening of the pen. They stayed "watching their flocks by night" with their sheep.
The pen looked something like this:
And the shepherd would lie across the opening, sleeping with his sheep, and making sure that none would get out during the night. Also protecting them from wolves or other predators.
So, the shepherd was in fact the gate.
That's what Jesus meant when He said He is the gate.
He protects us from evil and stops us from going astray.