Blessed are the pure in heart, for they will see God. Matthew 5:8
In Malachi 3:2 Jesus is described as a “Refiner’s Fire” and His ministry is described as refining His people, making them pure in heart. Ephesians 5:27 tells us that Jesus, “will present her (the church) to Himself as a radiant church, without stain or wrinkle or any other blemish.” He will do this by using circumstances in our lives to reveal our heart attitudes. When our wrong attitudes are exposed, we then desire the change He longs to bring.
Psalm 66:10 gives us an example of this: “For you, O God, tested us; you refined us like silver”. In verses 11 & 12 it details how God tested them, “You brought us into prison and laid burdens on our backs. You let men ride over our heads; we went through fire and water,” and next it tells us the result, “but you brought us to a place of abundance.”
God wants to bring us to a place of abundance for John 10:10 tells us that Jesus came that we might have abundant life. Yet we must be prepared to submit ourselves to God’s refining work in our lives. David was prepared to do this and prayed, “Search me, O God, and know my heart; test me and know my anxious thoughts. See if there is any offensive way in me,” (Psalm 139:24).
The blessing of God comes to those who are prepared to deal with their inner attitudes and motives in order to make them right before God and thus be pure in heart.
While this last sentence may be true (and is well said), there are also times when God refines us even when our heals are firmly entrenched. More here... http://managedsurrender.com/spilling-scripture/clearer-vision/what-do-i-know-of-holy/