The context of faith in James 2 is faith that saves.
James{2:14}
What [doth it] profit, my brethren, though a man say he hath faith, and have not works? can faith save him?
And that faith is not dead faith alone.
Jas 2:17
Even so faith, if it hath not works, is dead, being alone.
The context of faith in Eph 2 is the faith toward God that saves, vs the faith in ourselves to boast of. That's why Eph 2 and James 2 do not contradict God's teaching on faith that saves, and faith that does not.
That's because the faith given by Jesus Christ in Eph 2 is the same faith in Rom 5, 10, etc...
Rom 5:1
Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God.
That faith by grace toward God, is not the faith of man toward himself, and especially not the faith alone, that's dead toward God and man.
James 2:15
If a brother or sister be naked, and destitute of daily food, And one of you say unto them, Depart in peace, be ye warmed and filled; notwithstanding ye give them not those things which are needful to the body; what doth it profit? Even so faith, if it hath not works, is dead, being alone.
There are no different aspects of faith in Christ. His faith is one:
Eph 4:2
There is one body, and one Spirit, even as ye are called in one hope of your calling; One Lord, one faith, one baptism, One God and Father of all, who is above all, and through all, and in you all.
There are different faiths in the world: The faith that is of God. The faith that is of man. And the faith that is dead.
If the faith of God is not saving us from our own dead works, then His faith is not given us at all, initially or otherwise.
Only those that repent of their dead works, and receive the gift of faith toward God are justified by works.
The same as Abraham and Rahab were justified by works of faith toward God:
James{2:21}
Was not Abraham our father justified by works, when he had offered Isaac his son upon the altar? Ye see then how that by works a man is justified, and not by faith only…Likewise also was not Rahab the harlot justified by works, when she had received the messengers, and had sent [them] out another way?
Works of the law that do not justify, are by faith toward oneself to boast of.
Psa 146:3
Put not your trust in princes, nor in the son of man, in whom there is no help.
Eph 2 separates the faith of God, from the faith of man. James 2 separates the faith of God from the faith that's dead.
James 2 is on the only works that justify by faith toward God, vs the faith without works that neither save nor justify.
By doing the works of God's faith, we work out our salvation.
Phl 2:12
Wherefore, my beloved, as ye have always obeyed, not as in my presence only, but now much more in my absence, work out your own salvation with fear and trembling.
Correct. James 2 says if we don't have works, we don't have the faith that saves from death.
James{2:14}
What [doth it] profit, my brethren, though a man say he hath faith, and have not works? can faith save him?...Even so faith, if it hath not works, is dead, being alone.
It's John 3, that says if we don't have the faith of God, we don't have the eternal life of God.
Jhn 3:15
That whosoever believeth in him should not perish, but have eternal life.
If we're not doing the works of God, we don't have the faith and eternal life of God.
Salvation and service. Without one there is not the other.
Rom 12:1
I beseech you therefore, brethren, by the mercies of God, that ye present your bodies a living sacrifice, holy, acceptable unto God, which is your reasonable service.
If we're not doing the good will of God, we don't abide forever, because we don't have the faith of God.
1Jo 2:15
Love not the world, neither the things that are in the world. If any man love the world, the love of the Father is not in him. For all that is in the world, the lust of the flesh, and the lust of the eyes, and the pride of life, is not of the Father, but is of the world. And the world passeth away, and the lust thereof: but he that doeth the will of God abideth for ever.
Justification vs sanctification is of man's own faith.
Jer 3:8
And I saw, when for all the causes whereby backsliding Israel committed adultery I had put her away, and given her a bill of divorce; yet her treacherous sister Judah feared not, but went and played the harlot also…And yet for all this her treacherous sister Judah hath not turned unto me with her whole heart, but feignedly, saith the LORD.
Justification and sanctification is of God's own faith.
1 Cor 6:11
And such were some of you: but ye are washed, but ye are sanctified, but ye are justified in the name of the Lord Jesus, and by the Spirit of our God.
There is no sanctification of God without being washed by God. There is no justification by God, without being sanctified with God.