In Romans 3:28 Paul writes: “We maintain that a man is justified by faith apart from observing the law. James is not contradicting salvation by faith. But it is not a dead faith but a living faith that motivates our actions. James is simply defining true, saving faith. “What good is it, my brothers, if a man claims to have faith but has no deeds? Can such faith save him?
James asks “Can that kind of faith save him? This is a dead faith, lifeless. It produces no works. “Show me your faith without deeds, and I will show you my faith by what I do. You believe that there is one God. Good! Even the demons believe that—and shudder”. A person can believe the historical facts about Jesus, this is important, but a mere mental acknowledgment is not enough. Even demons believe in that sense, but True faith must change our lives.
In verses 21-24 shows that Abraham had a true living faith, not one that lays dormant but is active. Then in verses 25-26 we see that the prostitute Rahab showed her living faith by protecting the spies sent by Joshua (Joshua chapter 2). So clearly there is no contradiction between Paul and James.