Anybody can say, "I have faith in God." Yet to make such a claim proves nothing. It is a statement of belief that the person makes, to others (for there is no need to make it to oneself!) Even the demons believe in the reality of God but they do not have faith in God. James said their knowledge of the reality of God makes them shudder (for they know what God is going to do to them - James 2:19-20). Belief in the existence of God is a given, from which faith in God may arise. Note that James goes on to say, "As the body without the spirit is dead, so faith without works is dead also" (vs. 26). Earlier, he said it profits nothing to say one has faith but does not have the works that prove a living faith. Just saying one has faith does nothing (vs.14).
This is necessary to state in order to understand what the believer does with respect to "works". Works of faith simply demonstrate that the claim to have faith is genuine. And such true works of faith always glorify God, not self. Yet many works of faith that please God are known only unto God. There should never be boasting or advertising of what works of faith one has done, as that indicates pride, and so would not honour God.
But no such genuine works of faith can be done unless God has first gifted faith to the individual, to bring them to spiritual newness of life. This is a work of the Holy Spirit who reveals just who Jesus is ("the Christ, the Son of the living God" as Peter said when the Father revealed that to him from heaven - Matthew 16:15-18). The Holy Spirit reveals the mysteries of Christ, the gospel of Christ, and the mystery of being part of Christ's spiritual body, his Church. Without such revealing (as a gift from heaven) people may think they have faith, but it is not saving faith, because it's only knowledge about God and Christ. The significance of God, Christ and the Church is only gifted with the gift of faith. That has to come first and nobody can muster up such saving faith for themselves, no matter how much head-knowledge they have. As Jesus said:
"To you it is given to know the mysteries of the kingdom of heaven,
but to them it is not given." Matthew 13:11 A.V.
"All things are delivered unto me of my Father, and no man knoweth the
Son, but the Father; neither knoweth any man the Father, save the Son
and he to whomsoever the Son will reveal him." Matthew 11:27 A.V.
There has to be a coming to Christ first, and then the Father reveals the hidden mysteries of Christ and the Kingdom by imparting his gift of faith.
Only thereafter can a new-born Christian start to do any works of faith that honour God. Those works do not give him any merit as to salvation, but they testify to an unbelieving world that such people are different, for the Spirit of Christ now indwells all who are part of his Church - Colossians 1:27. Unbelievers should be stopped in their tracks to consider the faith and loving good works such people do. Of course, those who are not Christians often also do loving good works, but because the faith from God is not there, no pointing to Christ, no sharing of the gospel of Christ will follow. Christians should do both those things in tandem with their good works. Then God is glorified and others may see Christ in the midst.
In that latter case, the main answer becomes clear: Christians do do good works because of their faith, but without first having been given saving faith in Christ from God, those good works are not the good works the Bible speaks of.
The secondary answer also should be clear now: Only God can bestow saving faith on anyone, so that none can boast. Good works do not save anyone, but those who have been saved by grace will do good works because they have been saved. Faith cannot be a work that contributes towards our salvation, for good works that honour God only arise from the gift of faith he first bestowed on us, undeservedly.
God gives the faith that saves (which cannot be a work on God's part for it is a gift), thereafter the saved do the good works that result from saving faith.