What then are we to say was gained by Abraham, our ancestor according to the flesh? 2For if Abraham was justified by works, he has something to boast about, but not before God. 3For what does the scripture say? “Abraham believed God, and it was reckoned to him as righteousness.” 4Now to one who works, wages are not reckoned as a gift but as something due. 5But to one who without works trusts him who justifies the ungodly, such faith is reckoned as righteousness. (Romans 4:1-5, NRSV)
Pretty simple actually when you look at it the way Paul lays it out here. When you work, the money you earn is not a gift but is due to you for the labor you did. But the gift we received from God by which we are made right is not due to us for works we have done but is the gift of God.
So if you believe God then you are like Abraham and are justified by God.
But isn’t believing a work? Yes and no. It could be, but it also isn’t.
Faith is trusting that the promises are true but really isn’t doing anything.
So Believe the promises and be justified.