8 For it is by grace you have been saved, through faith – and this is not from yourselves, it is the gift of God – 9 not by works, so that no one can boast.
We can't earn salvation - apart from our inherent sinfulness, there is no way we could ever do enough to earn it.
It's only through God - through trusting in him and following Him that we can be saved.
James talks about being "justified by works, and not by faith alone" - this doesn't mean that we can be saved by our deeds, rather that our deeds should follow on from our faith, and indeed, that faith without any appropriate deeds is no faith - we are merely paying lip-service to faith.
Let us hold firm to our faith, let us not boast about our deeds, and let us accept God's grace, freely poured out to all those who accept him.