Our good works can never cancel out our bad deeds. Therefore, we can never be saved by our own works, because our own works are not perfect. And good deeds can't cover up bad deeds. Only by Jesus' work on the cross (His dying for our sins in our place) are we saved.
Jesus says, "I am the way, and the truth, and the life; no one comes to the Father but through Me” (John 14:6). And Jesus says, "I am the resurrection and the life; he who believes in Me will live even if he dies, and everyone who lives and believes in Me will never die" (John 11:25-26).
So salvation is not based on our own imperfect works, but based on believing in Christ.
There is another aspect to believing. That is, if we truly believe, we would act like we believe. This is what Jesus explains in Matthew 7.
https://www.bible.com/bible/100/MAT.7.NASB1995
“Not everyone who says to Me, ‘Lord, Lord’, will enter the kingdom of heaven, but he who does the will of My Father who is in heaven will enter. Many will say to Me on that day, ‘Lord, Lord, did we not prophesy in Your name, and in Your name cast out demons, and in Your name perform many miracles?’ And then I will declare to them, ‘I never knew you; depart from Me, you who practice lawlessness'” (Matthew 7:21-23).
God is not impressed if people work miracles in His name, but in their hearts, they are far away from God. People could work miracles but be using the power of darkness. Or people could falsely prophesy in God's name even though God had not spoken to them.
Even the devil and false prophet can work miracles (Revelation 13:13-14). Even the demons know God exists and tremble: “You believe that God is one. You do well; the demons also believe, and shudder” (James 2:19).
Jesus says that those who say they believe, but purposefully don’t obey God are those who practice lawlessness.
Jesus tells us to act on His words instead of simply listen to His words.
“Therefore everyone who hears these words of Mine and acts on them, may be compared to a wise man who built his house on the rock. And the rain fell, and the floods came, and the winds blew and slammed against that house; and yet it did not fall, for it had been founded on the rock. Everyone who hears these words of Mine and does not act on them, will be like a foolish man who built his house on the sand. The rain fell, and the floods came, and the winds blew and slammed against that house; and it fell—and great was its fall.” (Matthew 7:24-27)
So we need to learn to do good, and practice Jesus’ teachings in our daily life.
Otherwise, Jesus would ask, "Why do you call Me, ‘Lord, Lord’, and do not do what I say?" (Luke 6:46).
Truly believing is two parts. One is having faith in Jesus. The other is repentance. Repentance is turning away from evil and learning to follow Christ. We could still sin after we believe, so we need to ask for God's forgiveness. “If we confess our sins, He is faithful and righteous to forgive us our sins and to cleanse us from all unrighteousness” (1 John 1:9). So we need to work with God to overcome sins. With God's help and our diligence, we can learn to overcome sins and obey God.
The apostle Paul summed up what believing in Christ truly means:
"I preached that they should repent and turn to God and demonstrate their repentance by their deeds" (Acts 26:20).
And again: "I have declared to both Jews and Greeks that they must turn to God in repentance and have faith in our Lord Jesus" (Acts 20:21).
So truly believing means to have faith in Jesus and be learning to obey Him.