Salvation is a Covenant by God, not a contract with man.
Jesus says that the new Testament is in His blood, it is a covenant vow made by the blood of God (Acts 20:28). (Testament literally means “Covenant” in the original Greek - The Old and New Covenant/Testament)

Luke 22:20) Likewise also the cup after supper, saying, This cup is the new testament in my blood, which is shed for you.
1Corinthians 11:25) After the same manner also he took the cup, when he had supped, saying, This cup is the new testament in my blood: this do ye, as oft as ye drink it, in remembrance of me.
Hebrews 12:24) And to Jesus the mediator of the new covenant, and to the blood of sprinkling, that speaketh better things than that of Abel.

John 1:12-13) "But as many as received him, to them gave he power to become the sons of God, even to them that believe on his name: Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God." - not by our blood, but the blood of God. Not by our will or power, but only of God. As Jesus said "no man can pluck you out of my hand" that means you cannot pluck yourself out either - not by your will. You cannot walk away/give up the faith (become unsaved again).

2 Timothy 2:13) If we believe not, yet he abideth faithful: he cannot deny himself.

Psalm 9:4) “For thou hast maintained my right and my cause; thou satest in the throne judging right.”

Salvation is not about what we do or keep or abstain from, it is solely based on what you have believed. 1John 5:13) "These things have I written unto you that believe on the name of the Son of God; that ye may know that ye have eternal life, and that ye may believe on the name of the Son of God."
As it says "THAT YE MAY KNOW" absolute assurance of your salvation, and this is because you have believed.

John 1:13) "Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God."
It has nothing to do with our abilities of anything, salvation is only by the power of God which comes upon us when we believe on the Lord Jesus Christ.

Romans 10:9-10) That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved. For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation.

Acts 10:43) To him give all the prophets witness, that through his name whosoever believeth in him shall receive remission of sins.

Ephesians 1:13) In whom ye also trusted, after that ye heard the word of truth, the gospel of your salvation: in whom also after that ye believed, ye were sealed with that holy Spirit of promise

John 3:16-17) For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. For God sent not his Son into the world to condemn the world; but that the world through him might be saved.

1 John 5:20) And we know that the Son of God is come, and hath given us an understanding, that we may know him that is true, and we are in him that is true, even in his Son Jesus Christ. This is the true God, and eternal life.

John 1:13) “Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God.”
Eph 1:7 / Acts 10:43 / Eph 1:13 & 4:30 /

Salvation is a free gift, no maintenance, no earning of favor, and once given it cannot be taken away. Ephesians 4:30) "And grieve not the holy Spirit of God, whereby ye are sealed unto the day of redemption."- if we do grieve Him we just confess and we are cleansed. The Father doesn't disown the wayward child, but like the prodigal son the goodness of God leads us to repentance and cleansing - When did the prodigal son cease to be a son of the Father?

Salvation is NOT by works, NOT by righteous works, NOT by deeds of the law, and NOT by sight. But by Faith alone, through Grace alone, by Jesus Christ who is God alone -
Titus 3:5 / Ephesians 2:8-9 / Galatians 2:16 / 2 Corinthians 5:7 / Romans 1:17 / Romans 6:14 / Hebrews 10:38.

Romans 10:9-10) “That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved. For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation.”

After believing and repenting you are sealed/saved, then because of your love for Christ you want to follow Him. Ephesians 1:13 and Ephesians 4:30 - It's not because you have to but because you want to.

James 2 is not talking about works to keep your salvation, but rather it's talking to Christians already saved, and it's talking about charity and Christian behavior for promotion of the faith, not maintenance of salvation. If James is talking about maintaining salvation then Apostle Paul is a liar.