The extended section when Jesus speaks of the Good Shepherd* comes halfway through the Fourth Gospel, and probably constitutes the heart of its teaching.
Here Jesus seems to be telling us the 'mechanism' by which he, personally, is offering us life everlasting; here he tells us by a long metaphor-parable just how-it-works.
It is about the Good Shepherd (and no other) saving his sheep from being killed; and we know from the rest of the Gospel that this means saving Man from death, by enabling resurrected life eternal in Heaven. The Good Shepherd leads his sheep through death to Heaven.
We hear about the two-sidedness of salvation: 'I know my sheep and are known of mine'. The Good Shepherd seeks us out, and we each recognise him.
On the one hand, fake shepherds (the hireling) cannot save. On the other hand, those who do not 'know' (believe-in, love, trust, have-faith-in) Jesus will not be saved.
What is led? The soul, after death. But why does it need to be led - why can't it find its own way to salvation? Because after death the soul becomes 'helpless', lacks agency - like a young child, a ghost, a sheep.
If unable to help itself, how then can the soul follow Jesus? Because - like a young child, or sheep - the dead soul still can recognise and love; and 'follow'.
Where does this happen? In the 'underworld'. Without Jesus, the disembodied, ghostly, demented dead souls wander like lost sheep - as described in pre-Christian accounts such as Hades of the Greeks, or Sheol of the Ancient Hebrews.
But how does Jesus save the dead souls? Everybody has known Jesus as spirits in the premortal world, so everybody can recognise him in the underworld; but only those who love Jesus will want to follow him.
So loving dead souls are the sheep that can recognise Jesus: the Good Shepherd, they can follow Jesus, and Jesus can lead them to Resurrected Life Everlasting.
Note: Souls that do not love Jesus will recognise him, but will not want to follow him. There are significant nuances to this, relating to love of 'neighbour' and the desires of individual souls; but that is the basic model.
Further note: This seems to be very hard for moderns to grasp; they seem to think that Jesus ought-to save people even when they don't want it - should compel people to Heaven because that is what is good for them - and if Jesus does not do this, then he is wicked.
But this attitude is totalitarian - based on the secular ideology of utilitarianism so beloved by the modern Establishment - who like to believe that (being wiser, cleverer and more virtuous people than the masses) they are 'managing' the world, 'for their own good'.
But Christianity is based around the creative freedom and agency of each individual person. This means that nobody can be saved against their will; each individual can, if he wills, defy the wishes of God. Whether you regard this a a good thing (I do) it is a fact of post-mortal life - Heaven must be chosen.
*John.10
[1] Verily, verily, I say unto you, He that entereth not by the door into the sheepfold, but climbeth up some other way, the same is a thief and a robber.
[2] But he that entereth in by the door is the shepherd of the sheep.
[3] To him the porter openeth; and the sheep hear his voice: and he calleth his own sheep by name, and leadeth them out.
[4] And when he putteth forth his own sheep, he goeth before them, and the sheep follow him: for they know his voice.
[5] And a stranger will they not follow, but will flee from him: for they know not the voice of strangers.
[6] This parable spake Jesus unto them: but they understood not what things they were which he spake unto them.
[7] Then said Jesus unto them again, Verily, verily, I say unto you, I am the door of the sheep.
[8] All that ever came before me are thieves and robbers: but the sheep did not hear them.
[9] I am the door: by me if any man enter in, he shall be saved, and shall go in and out, and find pasture.
[10] The thief cometh not, but for to steal, and to kill, and to destroy: I am come that they might have life, and that they might have it more abundantly.
[11] I am the good shepherd: the good shepherd giveth his life for the sheep.
[12] But he that is an hireling, and not the shepherd, whose own the sheep are not, seeth the wolf coming, and leaveth the sheep, and fleeth: and the wolf catcheth them, and scattereth the sheep.
[13] The hireling fleeth, because he is an hireling, and careth not for the sheep.
[14] I am the good shepherd, and know my sheep, and am known of mine.
[15] As the Father knoweth me, even so know I the Father: and I lay down my life for the sheep.
[16] And other sheep I have, which are not of this fold: them also I must bring, and they shall hear my voice; and there shall be one fold, and one shepherd.
[17] Therefore doth my Father love me, because I lay down my life, that I might take it again.
[18] No man taketh it from me, but I lay it down of myself. I have power to lay it down, and I have power to take it again. This commandment have I received of my Father.
[19] There was a division therefore again among the Jews for these sayings.
[20] And many of them said, He hath a devil, and is mad; why hear ye him?
[21] Others said, These are not the words of him that hath a devil. Can a devil open the eyes of the blind?
[22] And it was at Jerusalem the feast of the dedication, and it was winter.
[23] And Jesus walked in the temple in Solomon's porch.
[24] Then came the Jews round about him, and said unto him, How long dost thou make us to doubt? If thou be the Christ, tell us plainly.
[25] Jesus answered them, I told you, and ye believed not: the works that I do in my Father's name, they bear witness of me.
[26] But ye believe not, because ye are not of my sheep, as I said unto you.
[27] My sheep hear my voice, and I know them, and they follow me:
[28] And I give unto them eternal life; and they shall never perish, neither shall any man pluck them out of my hand.