Matthew 25:31 When the Son of man shall come in his glory, and all the holy angels with him, then shall he sit upon the throne of his glory: 32 And before him shall be gathered all nations: and he shall separate them one from another, as a shepherd divideth his sheep from the goats: 33 And he shall set the sheep on his right hand, but the goats on the left. 34 Then shall the King say unto them on his right hand, Come, ye blessed of my Father, inherit the kingdom prepared for you from the foundation of the world: 35 For I was an hungred, and ye gave me meat: I was thirsty, and ye gave me drink: I was a stranger, and ye took me in: 36 Naked, and ye clothed me: I was sick, and ye visited me: I was in prison, and ye came unto me. 37 Then shall the righteous answer him, saying, Lord, when saw we thee an hungred, and fed thee? or thirsty, and gave thee drink? 38 When saw we thee a stranger, and took thee in? or naked, and clothed thee? 39 Or when saw we thee sick, or in prison, and came unto thee? 40 And the King shall answer and say unto them, Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me. 41 Then shall he say also unto them on the left hand, Depart from me, ye cursed, into everlasting fire, prepared for the devil and his angels: 42 For I was an hungred, and ye gave me no meat: I was thirsty, and ye gave me no drink: 43 I was a stranger, and ye took me not in: naked, and ye clothed me not: sick, and in prison, and ye visited me not. 44 Then shall they also answer him, saying, Lord, when saw we thee an hungred, or athirst, or a stranger, or naked, or sick, or in prison, and did not minister unto thee? 45 Then shall he answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to me. 46 And these shall go away into everlasting punishment: but the righteous into life eternal.
This is a parable of the judgment.
Jesus Christ is God’s appointed judge.
John 5:22 For the Father judgeth no man, but hath committed all judgment unto the Son:
God has appointed a day when Jesus Christ will return to judge the world.
Acts 17:31 Because he (God) hath appointed a day, in the which he will judge the world in righteousness by that man whom he hath ordained; whereof he hath given assurance unto all men, in that he hath raised him from the dead.
When Jesus returns, he will raise and judge the responsible dead and judge them along with the responsible living.
John 5:28 Marvel not at this: for the hour is coming, in the which all that are in the graves shall hear his voice, 29 And shall come forth; they that have done good, unto the resurrection of life; and they that have done evil, unto the resurrection of damnation (condemnation).
The faithful will be given eternal life and the unfaithful will be condemned to die again and perish forever.
Each will be judged according to their works.
Matthew 16:27 For the Son of man shall come in the glory of his Father with his angels; and then he shall reward every man according to his works.
Revelation 22:12 And, behold, I come quickly; and my reward is with me, to give every man according as his work shall be.
The works are not the works of the Law of Moses.
Galatians 2:16 Knowing that a man is not justified by the works of the law, but by the faith of Jesus Christ, even we have believed in Jesus Christ, that we might be justified by the faith of Christ, and not by the works of the law: for by the works of the law shall no flesh be justified.
The works are the works of faith; without which faith is dead.
James 2:14 What doth it profit, my brethren, though a man say he hath faith, and have not works? can faith save him? 15 If a brother or sister be naked, and destitute of daily food, 16 And one of you say unto them, Depart in peace, be ye warmed and filled; notwithstanding ye give them not those things which are needful to the body; what doth it profit? 17 Even so faith, if it hath not works, is dead, being alone. 18 Yea, a man may say, Thou hast faith, and I have works: shew me thy faith without thy works, and I will shew thee my faith by my works.
Works of faith consist of acts of love shown to our fellow men.
1 John 3:23 And this is his commandment, That we should believe on the name of his Son Jesus Christ, and love one another, as he gave us commandment.
We are to love one another in practical ways - to give food and drink to the hungry; to supply clothing for those who lack; to lodge strangers; to visit the sick and those in prison.
Those in Christ who have done these things are classed as sheep.
Those who have not done these things are classed as goats.
The sheep are given eternal life and enter into the kingdom of God.
The kingdom of God is the restored kingdom of David from whose throne Christ will reign over the earth.
Luke 1:32 He shall be great, and shall be called the Son of the Highest: and the Lord God shall give unto him the throne of his father David: 33 And he shall reign over the house of Jacob for ever; and of his kingdom there shall be no end.
The goats are condemned to die again and perish forever. This is called the second death. It is called everlasting punishment because the second death is permanent - the wages of sin is death.
I hope you find this helpful.