The Bible teaches that salvation is a gift of God that we receive through faith and is not the result of any work that we have done.
For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, not a result of works, so that no one may boast.
But the Bible also says that we will be judged for what we do.
For we must all appear before the judgment seat of Christ, so that each one may receive what is due for what he has done in the body, whether good or evil.
2 Corinthians 5:10
How can these two facts be reconciled?