Jesus said that a good tree does not bear rotten fruit, nor does a rotten tree bear good fruit. In other words, a good cook makes a good meal, a good barber makes a good haircut, and a good programmer writes a good program. The point that Jesus wants us to understand is that a good person does good deeds, and an evil person does evil deeds.
We should not respond to this teaching by trying to do as many good deeds as possible, so as to prove to everyone that we are good people. Nor should we arm ourselves with this teaching to reach conclusions about who is ultimately good and who is ultimately bad. Life is, in fact, much too gray for us to sort it out.
But here is one point that can be taken away: if we wish to do good, we must first become good. In other words, we must first seek to be transformed interiorly from a rotten tree into a good tree. We must purge ourselves, again and again, of what is rotten inside, and be healed and transformed by God’s grace, because it is only God’s grace that is capable of making us into a good tree. Therefore, the sacraments are essential, and so is prayer. We must cultivate the supernatural virtues and the gifts of the Holy Spirit. We must avoid sin and the near occasions of sin. In short, we must be grafted on to Him who said “I am the true vine, and my Father is the vine grower.”