Matthew 12.33-37 says, “Either make the tree good and its fruit good, or make the tree bad and its fruit bad, for the tree is known by its fruit (i.e. its fruit is evidence of what kind of tree it is). You brood of vipers! How can you speak good, when you are ¹evil? For out of the abundance of the heart the mouth speaks. The ²good person out of his good treasure brings forth good, and the evil person out of his evil treasure brings forth evil - (i.e. whatever is in the heart, whether good or evil, flows out. This is not describing something we must do, it's simply telling us what happens based on the condition of our heart).
I tell you, on the day of judgment people will give account for every careless word they speak, for by your words you will be justified, and by your words you will be condemned.” (ESV) i.e. our words will be evidence of a just or evil heart.
The ERV also gives a helpful translation...
33 “If you want good fruit, you must make the tree good. If your tree is not good, it will have bad fruit. A tree is known by the kind of fruit it produces. 34 You snakes! You are so evil. How can you say anything good? What people say with their mouths comes from what fills their hearts. 35 Those who are good have good things saved in their hearts. That’s why they say good things. But those who are evil have hearts full of evil, and that’s why they say things that are evil. 36 I tell you that everyone will have to answer for all the careless things they have said. This will happen on the day of judgment. 37 Your words will be used to judge you. What you have said will show whether you are right or whether you are guilty.” ERV
Early in my Christian life, I found this passage confusing, as I did many of the things Christ said. The reason is what Christ says sounds like salvation is the result of our efforts "...by your words you will be justified, and by your words you will be condemned.”
If a man is condemned by his words, are not his words the cause of his condemnation? If you do bad things you get a bad result i.e. condemnation - and if you do good things you get a good result i.e. justification. The result is based on what you do or don't do; on good or bad words. So it sounds like salvation is based on saying good words i.e. Salvation is by works - good deeds.
But is this what Christ is saying? Not at all! At a closer look, He is actually saying just the opposite. He is saying evil words are evidence that we are already under condemnation i.e. We are not a child of God. In short, our hearts are evil and we are under the just judgment of God. This is also the point of the following passage.
“For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him. Whoever believes in him is not condemned, but whoever does not believe is condemned already, because he has not believed in the name of the only Son of God...” John 3:17-18.
This passage doesn't cite any particular bad deed. The issue is what we have not done yet versus what we have done. It says we live under condemnation because of our alienation from God.
But what did we do to cause this? There wasn't anything we did in terms of a particular action, such as murder, stealing, or lying. It's what we do not "do." We refuse to receive the solution God offers to address our alienation i.e. unbelief. We do not believe we need God the way God says we do. And we do not believe in the solution God provided to address that unbelief.
Our words and deeds are simply the result/evidence /fruit of the state of our heart i.e. we have and are turned away from God and in rebellion to him. As a result, we are under condemnation. This is our true condition. If we are evil we produce evil words/fruit. If we are good, we produce good words/fruit. Our words and deeds are evidence of the state of our heart, so in this sense, they justify or condemn us i.e. they reveal the true condition of our heart - by their fruit you will know them. The state of our heart is why we are justified or condemned.
Once I got a better handle on this passage, I found it very exciting. Why? Because it indicates living the Christian life is not something we must or can do in our own power but only by God's power, spirit, love, etc. are we able to live for God. If we wish to bear much fruit we don't double down in our efforts to do good, we double down on our faith in God's offer of love. The more his love gets ahold of our hearts the more good fruit we bear. It is his love (our belief in it for us) that produces fruit, not our efforts.
For a fuller discussion on this, the following posts should help.
Love is power
¹So what exactly is the evil Christ is referring to? It is the evil of being in rebellion toward God, resulting in our disconnection from Him. The biggest evidence is our refusal of his offer of restoration. Note the passage says "you being evil" and does not say you doing evil. He talks about doing later - i.e. "bringing forth" good or evil things - as the fruit of being evil. Distrust of God is evidence of a rebellious/evil heart.
If we are made to be in union with God and disconnected from that union, we are broken and are missing what we were designed to have - God in all His endless love. As a result, we break/hurt others.
This is the essence and heart of evil; to do things that harm others because we are not in union with our Creator as we were designed to be. We have chosen to be our own god versus having faith in the only true God. We live contrary to God's design of complete dependence/Union with Him. We are like a fish designed to live in pure life-giving water, but living in water full of mud. We blindly thrash about harming others and, ultimately, ourselves and eventually die.
When we are not in union with the perfectly loving God we cannot do the things God designed us to do. Out of the void of a broken and empty heart only comes broken actions and words - evil - not good loving actions and words. As a result, we are under a state of condemnation if we are not in Christ.
Christ is clearly saying it is impossible for good fruit to come from an evil heart. A thorn bush cannot bear apples or oranges no matter how hard it trys because it is a thorn Bush.
If a heart is good it will bear good fruit. In other words, good fruit is evidence of a good heart, a heart that has been made righteous and set free from the requirement of perfect obedience in order to be approved and accepted by God. Good words do not cause one to be righteous but are evidence someone already is righteous by Christ's efforts.
Elsewhere, Christ stated, "...Whoever abides in me and I in him, he it is that bears much fruit, for apart from me you can do nothing. - John 15:5 ESV
It is not possible to produce good fruit unless we - the branches - are connected to or in union with the vine - abiding in God.
²What does Christ mean by "good person"? He is simply describing someone whose heart has been changed through union with God and is now abiding in Him and His love.
When we abide in him we produce good fruit i.e. do good deeds. It is the organic and inevitable outcome of that union because God is the source of life, love, and all things. To be "plugged in" to Him and His love makes us loving in the way God is and originally designed/created us to be i.e. The Father is the Vine keeper, Christ is the Vine through which life flows, and we are the branches through which life - God's very own life - is manifest in and through us as fruit i.e. loving acts - good deeds.