Once we are made righteous, our good deeds are righteous deeds and they are pleasing to God. They are not like filthy rags.
Ephesians 2:8-10
For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, 9 not of works, lest anyone should boast. 10 For we are His workmanship, created in Christ Jesus for good works, which God prepared beforehand that we should walk in them. nkjv
God would not command us to do good works if our good works were only like filthy rags to Him. God does not command us to do good works if it is impossible for us to do good works.
Romans 4
What then shall we say that Abraham our father has found according to the flesh? 2 For if Abraham was justified by works, he has something to boast about, but not before God. 3 For what does the Scripture say? “Abraham believed God, and it was accounted to him for righteousness.” 4 Now to him who works, the wages are not counted as grace but as debt. nkjv
Jesus first saved us when we repented and became Christians. We did nothing and could do nothing to deserve His saving grace.
However, our continuing justification/salvation depends on both God's continuing grace and our continuing response to His grace which is that we do the good works that He has prepared beforehand for us to do.
What happens to the people who do not bear the good fruit that God has prepared for them to do?
Matthew 25:31-46
Both faith and good works are necessary in order to inherit eternal life.
James 2:22-24
Do you see that faith was working together with his works, and by works faith was made perfect? 23 And the Scripture was fulfilled which says, “Abraham believed God, and it was accounted to him for righteousness.” And he was called the friend of God. 24 You see then that a man is justified by works, and not by faith only. nkjv
Matthew 21:43
“Therefore I say to you, the kingdom of God will be taken from you and given to a nation bearing the fruits of it. nkjv
John 8:31-32
Jesus then said to the Jews who had believed in him, “If you continue in my word, you are truly my disciples, 32 and you will know the truth, and the truth will make you free.” nkjv
1 John 2:3
And by this we may be sure that we know him, if we keep his commandments. nkjv
Matthew 7:22-23
On that day many will say to me, ‘Lord, Lord, did we not prophesy in your name, and cast out demons in your name, and do many mighty works in your name?’ 23 And then will I declare to them, ‘I never knew you; depart from me, you evildoers.’ nkjv