The New Testament states that we are not saved by works of law (Romans 3:28). This is a technical term in Jewish argot for ceremonial Jewish laws, in particular, circumcision.
This is why St. Paul hammers on circumcision (Romans 2:25-29, 3:1, 4:9-12, for example). He does this by pointing out that Abraham was justified (Romans 4:3, a quote of Genesis 15:6) long before he was circumcised (Genesis 17:24), thus proving that justification does not depend on circumcision (Romans 4:10-12), or any of the Jewish laws that came later on, but on faith.
His opponents were boasting about their circumcision and Jewishness (Romans 2:17, 25) but note that when St. Paul says Abraham was justified (Genesis 15:6), Abraham had already left Ur and had been following the Lord for quite some time (Genesis 12:1-4). If those, who argue that St. Paul is asserting that we are saved as soon as we respond to God, were correct, he would have said that Abraham was justified back in Genesis 12, not in Genesis 15. St. Paul says we are justified by faith, but he never once says we are justified by faith alone.
However, Catholics do not believe we are saved by works. The fact that we believe the newly-baptized infant who dies goes straight to Heaven proves this. (Actually a newly-baptized adult who manifests sincere faith would also go straight to Heaven if they died immediately after Baptism.) The Council of Trent decreed in 1547 that:
". . . man, by his own efforts and works, can never merit the initial grace of justification that makes him a child of God and a member of the New Covenant.
This grace is an entirely free gift from Jesus Christ conferred in Baptism."
(Session 6, chapter 8) (Catechism of the Catholic Church, CCC 1987–2011).
(The Ignatius Catholic Study Bible: The New Testament
(San Francisco: Ignatius Press, 2010), p. 262).
What we believe is that the just — i.e. those who are already saved — may increase in justification by doing deeds of charity (James 2:24).
Protestants do not believe in different levels of justification, so they do not believe the righteous can be further justified, so when they hear us speaking of justification by deeds of charity, they mistakenly conclude that we believe that the wicked can be justified by works.
We do not believe that the wicked can be justified by works, whether works of law or good deeds of charity. Nothing an unjustified (or unrighteous, or wicked) person can do is meritorious before God.
|CCC 2010 "Since the initiative belongs to God in the order of grace, no one can merit the initial grace of forgiveness and justification, at the beginning of conversion."
(Catholic Church, Catechism of the Catholic Church, # CCC 2010, 2nd Ed.
(Vatican City: Libreria Editrice Vaticana, 1997), p. 487)
Sacraments, such as the Eucharist and Baptism, are not works of man towards God, but channels funneling the grace of God to men. They are initiatives on the part of God, not man; man is merely a recipient. Eating and drinking are necessary for life; they are not works that merit life, but conduits of life we receive. So sacraments are conduits of grace.
Jesus says in John 15:4-6 (RSV2CE)
4 "Abide in me, and I in you. As the branch cannot bear fruit by itself, unless it abides in the vine, neither can you, unless you abide in me. 5 I am the vine, you are the branches. He who abides in me, and I in him, he it is that bears much fruit, for apart from me you can do nothing. 6 If a man does not abide in me, he is cast forth as a branch and withers; and the branches are gathered, thrown into the fire and burned."
Abiding is not a work we do to merit Eternal Life, any more than a branch merits remaining alive and bearing fruit by working being connected to the vine. Burdening the term work with such an overwrought meaning distorts what Scripture says.
Jesus uses simple and straightforward images: Eat and drink, and you will live. Wash, and you will be clean.
None of this has to do with works, and nothing in the Bible indicates so.