Romans 4:2 seems to say that Abraham was made righteous through faith and James 2:21 seems to say he was made righteous by works. Could you explain the context of James 2 because it seems to say that if you have faith but you don’t do works your faith is dead, implying that maybe you’re not saved.
The Bible is clear in stating that our salvation comes from faith, not works, as Paul explained in Romans 4:1-5, Ephesians 2:8-9, Titus 3:4-7 and other places.
What James said is that true faith will manifest itself in works, and he used Abraham as an example. In James 2:22 he wrote that Abraham’s faith and his actions were working together and his faith was made complete by what he did. Notice the faith came first and was made complete in subsequent action.
(Notice also that it was God who determined what action Abraham should take. Action we initiate on our own to somehow prove to others that we are saved is meaningless to the Lord.)
What James said was confirmed in Hebrews 11:17-19, where the writer used the same example.
“By faith Abraham, when God tested him, offered Isaac as a sacrifice. He who had received the promises was about to sacrifice his one and only son, even though God had said to him, ‘It is through Isaac that your offspring will be reckoned.’ Abraham reasoned that God could raise the dead, and figuratively speaking, he did receive Isaac back from death.”
Abraham had faith in God long before he was asked to sacrifice his son. Because of his faith he reasoned that God would keep His promise to bless the world though Isaac no matter what. He believed that even if he killed Isaac, God would raise him from the dead rather than break His promise. Taking action was evidence of his faith. Paul and James agreed.