In
James 2:15-16, the example of a "work" that James gives is: "If a brother or sister is naked and destitute of daily food, and one of you says to them, "Depart in peace, be warmed and filled," but you do not give them the things which are needed for the body, what does it profit?" So to give a brother or sister who are in need these things needed for the body certainly is an example of "works." Certain people like to play games with the word "works" then proceed to teach that we are saved by "these" works and just not "those" works. The apostle Paul leaves no room for salvation by works of any kind. (
Romans 4:2-6;
Ephesians 2:8,9;
Philippians 3:9;
Titus 3:5;
2 Timothy 1:9 etc..).
The verses by Paul you cite here merely say we are not saved by works ALONE - they do NOT say works are irrelevant to salvation. So while Paul clearly doesn’t preach salvation by works ALONE, he does NOT preach that works are irrelevant to salvation.
On the contrary, Paul clearly preaches the same formula for salvation that James preaches - faith AND works. Here are some examples:
Paul sternly warns believers in Gal 5 that their sins can mean they will not inherit the kingdom of God. Sinning is “works”, just as obeying the commandments (ie, being holy and not sinning) is “works".
In Heb 12:14, Paul says, “Strive for … the holiness without which no one will see the Lord”. Holiness is keeping the commandments, which is “works” … without which, Paul says, “no one will see the Lord”.
In Romans 1:17, Paul says, “He who through faith is righteous shall live.” Paul is saying those who have faith and are “righteous” will be saved - righteousness is more or less the same as holiness, which is keeping the commandments, which is “works”.
In 1Cor 6:9-11, Paul says, ”Do you not know that the unrighteous will not inherit the kingdom of God? Do not be deceived; neither the immoral, nor idolaters, nor adulterers, nor homosexuals, nor thieves, nor the greedy, nor drunkards, nor revilers, nor robber
will inherit the kingdom of God.” This is Paul again preaching that sin can land believers in Hell. In other words, practising righteous/holiness/not sinning/keeping God’s commandments are necessary for salvation.
In Ephesians 2:10, Paul says, “For we are his workmanship, created in Christ Jesus for
good works, which God prepared beforehand,
that we should walk in them.“
In 2Cor 5:10, Paul warns believers that they will be judged according to their works: “For we must all appear before the judgement seat of Christ, so that each one may receive good or evil,
according to what he has done in the body.”
In Romans 2:4, Paul says, “Do you not know that God’s kindness is meant to lead you to repentance?” Repentance involves saying no to sin, and instead, obeying God commandments - which is “works”.
Eph 5:5-11, Paul warns believers: “Be sure of this, that no immoral or impure man, or one that is covetous (that is, an idolater) has any inheritance in the kingdom of Christ and of God.” This is Paul - yet again - preaching that sin (aka “works”) can destroy any hope of salvation.
Paul devotes the whole chapter of Romans 6 to explaining to believers that they must no longer practise sin, but righteousness, which is good works.