Matthew 7:21-23 is a commonly cited verse to "prove" that works are required for salvation. Faith isn't enough, you have to do good, and avoid bad, in order to go to Heaven. But because of verse 22, the passage actually shows the opposite. The people whom Jesus turns away are not people who had faith, but insufficient works, but rather they had works, but insufficient faith.
Look at what they say. They don't say "Lord, Lord, have we not confessed you as Lord and believed in our hearts that God raised you from the dead?" If they did, Romans 10:9 explicitly says they would be saved. Instead, these people focused on what they did. "Lord, did we not prophesy, did we not drive out demons, did we not do many miracles?" These are not statements of faith, but of works. They aren't statements that "we're not good enough, but you are". They are statements of "we're good enough, we've earned our wages". And so Jesus says "yes, you have. So go to Hell and take them."
See, the consistent testimony of scripture is that if you ask Jesus to judge you by your works, He will. But your works are an abomination to Him. Because of your sin, Isaiah tells us that even your righteous acts are filthy rags (Isaiah 64:6). I haven't been able to verify this, but I'm told that the original Hebrew of this verse specifically refers to a menstrual cloth.
There is a similar passage. In Luke 18:9-14, Jesus tells a parable of two people in a temple: A Pharisee and a tax collector. The tax collector bravely approaches the alter, thanks God that he is so great, boasts of his works, and belittles the tax collector for his sin. The tax collector, by contrast, behaves as if he is the only person in the room. He doesn't approach the alter, he doesn't try to justify himself, he doesn't even respond to the Pharisee's charges. Rather, he looks to the ground and beats his chest, saying "God, be merciful to me a sinner." Jesus' final word on the matter? "I tell you, this man went down to his house justified rather than the other; for everyone who exalts himself will be humbled, and he who humbles himself will be exalted."
None of us are good enough to get to Heaven. Every single one of us has fallen short, gone astray and polluted our garments. None of us get to Heaven because we are good. Rather, God is good, and so He is willing to give our wages to another, namely Jesus. If we claim we need to add anything to that, or that we can somehow lose that, we're saying that not even Jesus is good enough to get us to Heaven. I don't know about you, but looking at Matthew 7:21-23, I'd much rather confess my sins and beg His forgiveness than be the one to tell Him that.