The solution to the Ecclesiastes 7:15-22 conundrum involves the converted person's faith in God. At the same time, it also heavily involves his fear of God and applying thoughtful wisdom to ensure he analyzes the situation accurately. Two of these spiritual qualities are directly named in Ecclesiastes 7, while faith, which is not directly named, is critical to the right solution. Influencing all three qualities is knowing God well enough from within the relationship to activate them all correctly. Consider II Corinthians 5:4-7:
For we who are in this tent groan, being burdened, not because we want to be unclothed, but further clothed, that mortality may be swallowed up by life. Now He who has prepared us for this very thing is God, who also has given us the Spirit as a guarantee. So we are always confident, knowing that while we are at home in the body we are absent from the Lord. For we walk by faith, not by sight.
God is preparing us for entrance into His Kingdom in a similar way a human instructor prepares a school student for graduation and service. There are two major differences though: We must matriculate our lessons by faith, and in our case, the purpose—to be clothed with glory and eternal life—is huge by comparison.
These verses assure us that God has made a contract with us—the New Covenant—in which we are responsible for carrying out assigned duties. He is preparing us to fulfill those responsibilities to a far greater extent in His Kingdom. As He is preparing us, we must live by faith.
Luke 14:26-27 reminds us of the seriousness of the pledge we made to Jesus Christ at baptism, to live by faith while carrying out our responsibilities. This serious commitment works in our favor. Knowing God's character from the midst of this close relationship, we can always confidently be reassured that God is in control despite how difficult events look to us. This truth became the foundation for the psalmist's victory in his situation (Psalm 73). Our responsibility is to trust Him as the psalmist did, to walk by faith, not by appearance or physical observation. God is faithful!
Paul, then, clearly establishes what our aim should be no matter the circumstances in our lives. We should desire to please God by being faithful to Him in return as demonstrated by trusting Him. He reinforces this by stating that we must be ready to answer for our choices.
Romans and Ephesians make it clear that God accepts us in His presence at conversion and at all times during conversion only upon the meritorious sinless works of Jesus Christ. This is because, as Paul shows in Romans 7, sin stains all our works no matter how meritorious they may seem to us.