The Apostle James writes that we are justified by works and faith together. The Apostle Paul writes we are saved by grace through faith. Since the scripture cannot be broken, both must be equally true. We are being saved by grace through faith in concert with works of faith that produce fruit of righteousness, and it is the gift of God. Seest thou how faith wrought with his works, and by works was faith made perfect? 23 And the scripture was fulfilled which saith, Abraham believed God, and it was imputed unto him for righteousness: and he was called the Friend of God. 24 Ye see then how that by works a man is justified, and not by faith only. For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: 9 Not of works, lest any man should boast.
You'll never figure it out if you don't look at ALL the scripture...
The Apostle James is talking about how OTHERS see our faith, how that a genuine faith WILL show by the fruit it bears. That is why James repeats phrases like "you see" and "seest thou". Man looks on the outward appearance, God looks at the heart. We are saved by grace through faith, alone, but it is a faith that is not alone. The fruit genuine faith bears does NOT contribute to our salvation, because our salvation is NOT by works - we don't earn, deserve or merit eternal life - it is ALL by grace.
So, even before the law, after the law, after Christ came the first time, before and after He returns again, it is ALWAYS by grace that God saves us. The sheep did the courageous and right things during the Tribulation because they WERE sheep already. The "goats" were always goats and their actions showed it. Someone helping the Jews during the Tribulation did not turn a goat into a sheep, it just demonstrated that he/she really was a sheep.
When taking in the complete counsel of God’s revealed word, the scriptures, we know saved by Grace effects a change in the repentant sinner thus the regenerated soul marching lovingly and obediently to the clarion call of Christ Jesus our Lord and Savior.