From John Piper:
“And of course that leads every sensitive soul to cry out with the words of Proverbs 20:9, “Who can say, ‘I have made my heart clean; I am pure from my sin?'” And with the disciples: “Who then can be saved?”
Jesus’ answer comes back just like it did to the disciples in Matthew 19:26—and this is the rest of the answer—”With men it is impossible, but with God all things are possible.” In other words, God creates a purity for us and in us so that we can pursue purity. And by his grace we must seek that gift by praying with David, “Create in me a clean heart, O God” (Psalm 51:10). And we must look to Christ “who gave himself for us . . . to purify for himself a people” (Titus 2:14).
And the response of our hearts to God’s act of creation and Christ’s act of sacrifice is single-minded faith in Jesus Christ as Lord and Savior. As the Scripture says in Acts 15:9, “God made no distinction between us and them, but purified their hearts by faith.” God is the one who purifies the heart, and the instrument with which he cleans it is faith.”
In other words when we by trusting dependently in God’s work of purifying our hearts, he will instill in our hearts the motives and reasons of love and worship to God, through the power of the Holy Spirit. From that installment and work of grace, pursuit of purity will be one of continual receiving of grace, repenting by grace, and believing in future grace as we let God’s convicting work in our soul motivate us to desire a greater love for Jesus and a greater hatred for sin.