Imagine your best good work for God and your most heinous act. What do the two have in common? Sin. Both are tainted with it, the latter with it more apparent and yet the former undeniably has it crouching underneath, most likely veiled in self-righteous pride.
What is the solution to this dilemma? Faith.
God favors us in Christ. Nothing in ourselves is the ground of this favor. It is all Christ. Christ has earned God's favor for us. We can rest in the love of the Creator and Sustainer of the universe for it will never wane nor cease.
He has given us the privilege of calling Him Father.
Soli Deo Gloria!
Behold, his soul which is lifted up is not upright in him: but the just shall live by his faith (Habakkuk 2:4).
"But what does the just do? He brings nothing before God except faith: then he brings nothing of his own, because faith borrows, as it were, through favor, what is not in man's possession. He, then, who lives by faith, has no life in himself; but because he wants it, he flies for it to God alone. The Prophet also puts the verb in the future tense, in order to show the perpetuity of this life: for the unbelieving glory in a shadowy life; but the Lord will at last discover their folly, and they themselves shall really know that they have been deceived. But as God never disappoints the hope of his people, the Prophet promises here a perpetual life to the faithful...
But we obtain righteousness by faith alone for this reason, because God finds nothing in us which he can approve, or what may avail to obtain righteousness. Since it is so, we then see that to be true which the Holy Spirit everywhere declares respecting the character of men. Men indeed glory in a foolish conceit as to their own righteousness: but all philosophic virtues, as they call them, which men think they possess through free-will, are mere fumes; nay, they are the delusions of the devil, by which he bewitches the minds of men, so that they come not to God, but, on the contrary, precipitate themselves into the lowest deep, where they seek to exalt themselves beyond measure. However this may be, let us be fully convinced, that in man there is not even a particle either of rectitude or of righteousness; and that whatever men may try to do of themselves, is an abomination before God...
For no work proceeds from the perfect love of God, and where the perfect love of God does not exist, there is corruption there. It hence follows, that all our works are polluted before God; for they flow not except from the impure fountain of the heart. Were any to object and say, that the hearts of men are cleansed by the regeneration of the Spirit, we allow this; but at the same time much filth always remains in our hearts, and it ought to be sufficient for us to know that nothing is pure and genuine before God except where the perfect love of him exists." (John Calvin, Commentary on Habakkuk 2:4)