Grace is a gift and gifts can't be earned, so grace is incompatible with works insofar as they are done to earn a wage (Romans 11:6), however, works can be done for reasons that are compatible with grace. For example, a gift can be the experience of doing something, such as giving someone the opportunity to experience driving a Ferrari for an hour, where the gift intrinsically requires them to do the work of driving it in order to have that experience, but where doing that work contributes nothing towards earning the opportunity to drive it.
In Psalms 119:29-30, he wanted to put false ways far from him, for God to be gracious to him by teaching him to obey His law, and he chose the way of faith by setting it before him, so this has always been the one and only way of salvation by grace through faith alone.
In Exodus 33:13, Moses wanted God to be gracious to him by teaching him to walk in His way that he and Israel might know Him, and in Matthew 7:23, Jesus said that he would tell those who are workers of lawlessness to depart from him because he never knew them, so the goal of the law is to teach us how to know God and Jesus, which is His gift of eternal life (John 17:3), and which again is the gift of salvation by grace through faith.
In Genesis 6:8-9, Noah found grace in the eyes of God, he was a righteous man, and he walked with God, so God was gracious to him by teaching him to walk in His way and he was righteous because he obeyed through faith. In Romans 1:5, we have received grace in order to bring about the obedience of faith.
In Ephesians 2:8-10, we are new creations in Christ to do good works, so while Paul denied that we can earn our salvation as the result of our works lest anyone should boast, being made to be a doer of good works in obedience to God's law is nevertheless a central part of God's gift of salvation.
In Titus 2:11-13, our salvation is described as being trained by grace to do what is godly, righteous, and good, and to renounce doing what is ungodly, so doing those works has absolutely nothing to do with trying to contribute anything towards earning our salvation, but rather God graciously teaching us to be a doer of those works is part of His gift of salvation. In Titus 2:14, Jesus gave himself to redeem us from all lawlessness and to purify for himself a people of his own possession who are zealous for doing good works, so the way to believe in what Jesus spent his ministry teaching by word and by example and in what he accomplished through the cross is by repenting and becoming zealous for being a doer of good works in obedience to God's law (Acts 21:20).