A branch on the vine doesn't simply figure out what kind of plant it is and then look at the vine for instructions on how to bear fruit and then simply go about producing fruit. The branch "rests" (remains, abides) in the vine and draws all life and sustenance from the vine, and eventually (not immediately nor forcibly nor due to compulsion) the branch bears the fruit that the vine itself produces. It's a natural process, and if the branch tries to "help" the vine (such as when Abraham and Sarah tried to help God fulfill His promise that they would bear a son), the fruit that is produced is not God's natural fruit, no matter how lovely it might appear.
The rich young ruler was perhaps thinking that his "fruit" (keeping the commandments) was more than adequate to justify himself in front of a holy God. Jesus, by pointing out just how far short this man fell, caused him sadness as he realized he wasn't nearly as close to the kingdom of heaven as he thought. He went away sad, because just a few moments before he had considered himself close to the kingdom, but he now realized he was a lifetime away, because he hadn't realized that in order to come to God, he must give his entire life away.
IF ONLY he'd received the revelation that the Apostle Paul would eventually receive. (And perhaps one day he did receive this revelation). You not only have to give your life away, you have to die. But this death, of course, is not a death in which you physically give your body or your possessions away. It's a spiritual death, in which you give up any and all notions that anything you do - any of your law keeping or giving away of your possessions - will bring you even one step closer to God. You must die and be born again.
Yes! We can never do enough to earn it; we can never produce fruit; we can’t do anything except sin—apart from the empowering presence of almighty God in the form of the Holy Spirit (my favorite definition of grace)! But, when we rest in that power, we experience the love of God flowing through us and doing righteousness.