Luke 18:18 And a certain ruler asked him, saying, Good Master, what shall I do to inherit eternal life?
A good question, many believed this came by keeping God's commandments.
Luke 18:19 And Jesus said unto him, Why callest thou me good? none is good, save one, that is, God.
Jesus asks him a question, why you call me good? Only God is good? Jesus was God the Son, but the prince did not know this. We must know who Jesus is to enter the kingdom of heaven he said himself later:
John 14:6 Jesus saith unto him, I am the way, the truth, and the life: no man cometh unto the Father, but by me.
Salvation is by personal faith in Jesus. Compare this to the time Jesus was questioned by Pontius Pilate
John 18:33 Then Pilate entered into the judgment hall again, and called Jesus, and said unto him, Art thou the King of the Jews?
John 18:34 Jesus answered him, Sayest thou this thing of thyself, or did others tell it thee of me?
We must see Jesus as he truly is to receive him by faith and truth.
Luke 18:20 Thou knowest the commandments, Do not commit adultery, Do not kill, Do not steal, Do not bear false witness, Honour thy father and thy mother.
Luke 18:21 And he said, All these have I kept from my youth up.
Again, as most Jews, he knew the commandments and claimed to keep them. There is a difference in knowing the commandments and in having them written on your heart.
2 Cor 3:3 Forasmuch as ye are manifestly declared to be the epistle of Christ ministered by us, written not with ink, but with the Spirit of the living God; not in tables of stone, but in fleshly tables of the heart.
Luke 18:22 Now when Jesus heard these things, he said unto him, Yet lackest thou one thing: sell all that thou hast, and distribute unto the poor, and thou shalt have treasure in heaven: and come, follow me.
Luke 18:23 And when he heard this, he was very sorrowful: for he was very rich.
He was covetous desiring his riches more than heaven.
Luke 18:24 And when Jesus saw that he was very sorrowful, he said, How hardly shall they that have riches enter into the kingdom of God!
Where is your heart and confidence?
Mat 19:24 And again I say unto you, It is easier for a camel to go through the eye of a needle, than for a rich man to enter into the kingdom of God.
Mat 19:25 When his disciples heard it, they were exceedingly amazed, saying, Who then can be saved?
Mat 19:26 But Jesus beheld them, and said unto them, With men this is impossible; but with God all things are possible.