I think you miss the point of those verses. He framed his question with "WHAT MUST I DO". If he was
to inherit eternal life of his own accord and actions, then those requirements would have to be achieved by him. However, not only must he attempt to achieve them, but actually achieve them to perfection, never once varying from that perfection throughout his entire life, and not only that, but must also sell all he had, give it to the poor, and follow Jesus. Now, while not obvious, those requirements are full of spiritual meaning and inferences. The spiritual are really the true requirements of the requirements and impossible for man to satisfy. Nevertheless, do you believe that you have attained, and will continue to attain, all of those of yourself since you are apparently depending upon yourself and your works to enter into eternal life? In effect, the point that Jesus was making to him without directly saying it, was that they cannot be achieved by man, and should he attempt them, he would fail - read the verses below.
Their discussion continued with these verses. Notice that the young man realized those requirements were
unattainable, and as not having yet been saved so as to have been given faith in Christ as Saviour instead of himself, he left being saddened. Notice also in verse 26 we are informed that salvation and eternal life can only be as a gift from God. Notice the "all things"; that is, that everything pertaining to salvation is by God.
[Mat 19:22, 25-26 KJV]
22 But when the young man heard that saying, he went away sorrowful: for he had great possessions. ...
25 When his disciples heard [it], they were exceedingly amazed, saying, Who then can be saved?
26 But Jesus beheld [them], and said unto them, With men this is impossible; but with God all things are possible.