The writer to the Romans has it:
Rom 4:3 - For what does the Scripture say?
“Abraham believed God, and it was accounted to him for righteousness.”
James then has it:
Jas 2:21 - Was not Abraham our father justified by works when he offered Isaac his son on the altar?
Suppose Abraham had believed God and it was accounted to him as righteousness, but then refused to sacrifice Isaac? Does the writer to the Hebrews have the answer?
Heb 10:36 - For you have need of endurance, so that after you have done the will of God, you may receive the promise:
Why did Abraham sin and have sin in his life, yet it says he still obeyed and was obedient, etc...?
Could it be because of his faith his sin or sins were not charged against him...?
And when his faith was tested by an/the ultimate test of faith, and not sin, he was counted righteous because he passed the test of faith regardless or irregardless of what others might call him having sin, or sin in his life, etc...?
Because he was under the covenant of Grace which is by faith, and not law at that time, and because he passed the ultimate test of faith, etc, that any of his other sin or sins were not counted against him, etc...?
Or do you believe that Abraham was 100% totally sinless all his life or in his life or during his entire existence, etc...?
Cause I can tell you he most certainly wasn't, and even was not 100% totally sinless up until the day he died also, but he was declared righteous(and sinless) by faith and was described as being perfectly obedient and/or by, or because of, or due to his faith alone and faith only, etc, due his passing the ultimate test of faith, under the covenant of faith, etc, and not because he was totally and completely sinless ever, etc, but because it was not charged or ever counted against him, etc, and so he was declared sinless or righteous, obedient, etc, but not because he himself was perfectly sinless ever, etc...
Let me tell you a thing or two about the test, Abraham heard God audibly and very clearly, and there was no confusion at all, or any kind of doubt at all, when that God or that audible voice spoke to him, if and when and during the times in his life that it did speak to him or with him, etc. Anyway, there was absolutely no confusion or doubt about it at all, no wondering if it was really or God or that same voice ever, or not ever, etc, and they were or became "friends", and while this voice may have not spoken to or with him "constantly" or "all of the time", there was absolutely no doubt or confusion when He or it did, etc, no wondering if it was the same voice that he had heard before, or had now developed a real relationship with now from times past before, etc, or no doubt or confusion that he fully thought and fully "knew" (in his mind) that it was, or was supposed to be, "God's voice speaking to him" in Abraham's mind ever, etc, cause it was clearly audible when it did, etc, and was not when it wasn't, etc. Anyway absolutely zero doubt or confusion there, etc, and they were friends, or had a real genuine and true relationship going, etc, had built up some trust, and Abraham had built up some reliance on Abraham's part, etc...
Anyway, with this in mind, God or this voice made Abraham a promise that He would be a father of many nations, etc, descendants as numerous as the stars in the sky or the sand on the seashore, etc, and this was long before even having a child of his own, etc, but Abraham trusted Him or that or this audible voice, so he believed Him, etc, put faith in that ones word or words, etc, finally had a child or his own by his wife Sarah both in their old age, etc, and then finally, after years of having only faith to go on, Abraham could finally see God's promise coming to pass and/or happening in the future, etc, and they knew they would not ever have any more children, etc, for that one (Isaac) was a miracle, etc. Anyway, finally Abraham could see God's promise coming to pass and thought he had already fully passed or completed the full test of faith, etc, but, then God tells him to sacrifice him as a burnt offering, etc, and Abraham knew that he and his wife could not have any more children, etc, so how was the promise to come to pass, etc, it was the one final test of faith for Abraham, etc...
Abraham must have had all kinds of things going on his mind, and I'll bet God's audible voice was silent for awhile after He told Abraham to do it, etc... Was God going to change his mind at the last minute, provide His own sacrifice, etc, at the last minute, etc...? Or maybe he, and this might have been the point where Abraham's faith was perfected, maybe he might have begun to entertain the idea of God raising him (Isaac) from the dead, etc, cause God has to keep his promises right, he's not a liar or a rule-breaker, or a God that violates His own covenants or rules, etc, right, etc...?
He might have been the very first to entertain the idea, and put faith in God to be fully able to do it, etc, a thought or concept or idea he might never have had were it not for this one last final test, etc...
And Abraham obeyed that audible voice to the end, he lifted up that knife, had his son on the altar, and was just about ready to make it fall or do or strong downward stroke and plunge it into his beloved and one and only sons, and the child of promise's chest, etc, fully believing that what God, or what that audible voice had said or promised was going to made or cause to come to pass no matter what, even though it seemed impossible, that He would "raise Isaac from the dead" if He had to, etc, cause any other way, fully knowing that he knew he could not have any more children ever again, etc, and certainly not by his wife Sarah anymore, etc, anyway, etc...
He was going to go through with it, and after God finally saw that, He stopped him, and as they say, the rest is history, etc...
But it was not because Abraham was 100% perfect and/or totally sinless in his flesh, etc...
Anyway,
God Bless!