james 2:24 says no such thing!
And that is not a self-contradictory statement at all.
Salvation, as reiterated over & over in scripture, has but one human responsibility towards attainment: faith/ believe in the Lord Jesus Christ, & you shall be saved. Faith alone. After a person has been transformed, then good works must follow that faith.
The wretched unbeliever has no good works; if good works were the way to be saved, no one would ever be saved. Salvation is the Savior meeting our problem of being sinners who have no good works.
eph 2 spells it out:
Eph. 2:1
And you did he make alive, when ye were dead through your trespasses and sins, 2 wherein ye once walked according to the course of this world, according to the prince of the powers of the air, of the spirit that now worketh in the sons of disobedience; 3 among whom we also all once lived in the lusts of our flesh, doing the desires of the flesh and of the mind, and were by nature children of wrath, even as the rest:—
4 but God, being rich in mercy, for his great love wherewith he loved us, 5 even when we were dead through our trespasses, made us alive together with Christ (by grace have ye been saved), 6 and raised us up with him, and made us to sit with him in the heavenly places, in Christ Jesus: 7 that in the ages to come he might show the exceeding riches of his grace in kindness toward us in Christ Jesus:
8 for by grace have ye been saved through faith; and that not of yourselves, it is the gift of God; 9 not of works, that no man should glory. 10 For we are his workmanship, created in Christ Jesus for good works, which God afore prepared that we should walk in them.