In James 2:14, we read of one who says/claims he has faith but has no works (to evidence his claim). That is not genuine faith, but a bare profession of faith. So when James asks, "Can that faith save him?" he is saying nothing against genuine faith, but only against an empty profession of faith/dead faith. So James does not teach that we are saved "by" works. His concern is to show the reality of the faith professed by the individual (James 2:18) and demonstrate that the faith claimed (James 2:14) by the individual is genuine. Simple!
We show our faith by our works. Show, not establish. Big difference.
In James 2:19, we see that the demons believe "mental assent" that "there is one God," but they do not believe in/have faith in/trust in/reliance in Jesus Christ for salvation. In other words, they do not believe on the Lord Jesus Christ (Acts 16:31) and are not saved. Their trust and reliance is in Satan, as demonstrated by their rebellion in heaven and continuous evil works.
"Faith without works is dead" does not mean that faith is dead until it produces works and then it becomes a living faith or that works are the source of life in faith. That would be like saying that a tree is dead until it produces fruit and then it becomes a living tree, and the fruit is the source of life in the tree. James is simply saying faith that is not accompanied by evidential works demonstrates that it's dead.
If someone merely says-claims he has faith, but lacks resulting evidential works, then he demonstrates that he has an empty profession of faith/dead faith (James 2:14) and not authentic faith. We are made alive together with Christ by grace through faith FIRST then UNTO good works. (Ephesians 2:5-10)
The opposite of dead is alive. In Ephesians 2:5, we read - even when we were dead in trespasses, made us alive together with Christ (by grace you have been saved).... 8-9 by grace through faith, not works, 10 created in Christ Jesus unto/for good works. Christ is the source of life in our faith. Faith must be alive first before it can produce works. Just as a tree must be alive first before it can produce fruit. Life flows through faith (root of salvation) and produces works (fruit of salvation) just as life flows through the root of a tree and produces fruit.
Notice closely that James does not say that Abraham's work of offering up Isaac resulted in God's accounting Abraham as righteous. The accounting of Abraham's faith as righteousness was made in Genesis 15:6, many years before his work of offering up Isaac recorded in Genesis 22. The work of Abraham did not have some kind of intrinsic merit to account him as righteous, but it showed or manifested the genuineness of his faith. That is the "sense" in which Abraham was "justified by works." He was shown to be righteous.
Faith made perfect or complete by works means bring to maturity, to complete like love in 1 John 4:18. It does not mean that Abraham was finally saved based on merits of his works after he offered up Isaac on the altar in Genesis 22. When Abraham performed the good work in Genesis 22; he fulfilled the expectations created by the pronouncement of his faith in Genesis 15:6.
The scripture was fulfilled in vindicating or demonstrating that Abraham believed God and was accounted as righteous. Abraham was accounted as righteous based on his faith (Genesis 15:6) not his works (Romans 4:2-3) long before he offered up Isaac on the altar in Genesis 22.
James is not using the word "justified" here to mean "accounted as righteous" but is shown to be righteous. James is discussing the evidence of faith (says-claims to have faith but has no works/I will show you my faith by my works - James 2:14-18) and not the initial act of being accounted as righteous with God. (Romans 4:2-3) Works bear out the justification that already came by faith.
In the Strong's Exhaustive Concordance of the Bible, the Greek word for justified "dikaioo" #1344 is:
1. to render righteous or such he ought to be
2. to show, exhibit, evince, one to be righteous, such as he is and wishes himself to be considered
3. to declare, pronounce, one to be just, righteous, or such as he ought to be
In Matthew 12:37, we read - "For by your words you will be justified, and by your words you will be condemned." This is because our words (and our works) reveal the condition of our hearts. Words/works are evidence for, or against a man being in a state of righteousness.
God is said to have been justified by those who were baptized by John the Baptist (Luke 7:29). This act pronounced or declared God to be righteous. It did not make him righteous. The basis or ground for the pronouncement was the fact that God IS righteous. *Notice that the NIV reads, "acknowledged that God's way was right.." The ESV reads, "they declared God just.." That is the "sense" in which God was "justified." He was shown to be righteous.
Matthew 11:19 "The Son of Man came eating and drinking, and they say, 'Behold, a gluttonous man and a drunkard, a friend of tax-gatherers and sinners!' Yet wisdom is justified/vindicated/shown to be right by her deeds."