You cannot grow in love for God without growing in knowledge of God. It's hard to love someone we don't know well. How do we grow in knowledge of God?
In Psalm 139, the psalmist draws us into big thoughts of God. He leads us into awe of God similar to the wonder a child has for its father. When they go for a walk, it is joy enough for the child to walk with its father. The child is blissfully trusting of his father as he leads the child. The child is ever joyful and does not worry about obstacles in the path, for the child is confident that his father will help him overcome every hardship.
This psalm leads us to contemplate God's knowledge, presence, and craftsmanship. These big thoughts of God grow our knowledge of him and consequently our love for the God we know.
The psalmist praises God for his knowledge. God knows everything about me, even more than I know. Imagine a conversation with someone who knows our every motive, everything you will ever do, and every time you deceive yourself. This is an overwhelming amount of info. It is mind-boggling. Or, as the psalmist says in verse 6, "Such knowledge is too wonderful for me; it is high; I cannot attain it."
God knows your sin better than you do, but he is still patient with you. You know the sins of your close family and friends better than anyone else. How patient are you? God's attribute of being all-knowing is coupled with his attribute of patience. God knows the sin you have committed and will continue to commit, yet he is not annoyed, frustrated, or impatient that you don't understand and haven't changed yet. He is patient.
The knowledge of God is comforting in another way as well. The fact that we cannot hide from the Spirit or say, "Nobody understands what I'm going through." Not only does God know, he knows it better than you and he leads you through it (vv. 10-12). Our dark times are well lit to God. We cannot see a way forward, and the path ahead is dark. Yet, for God, he knows what is ahead and sees the path clearly. He leads you through hit as a father leads a child or as someone leads the blind through obstacles. Meanwhile, there is no need to fear that our Father will not successfully lead us through.
In fact, God not only knows the path ahead, he created it! Before you were even conceived and born, God knew your entire life (vv. 13-16). We rely on God in hard times and come out on the other side praising God (vv. 17-18).
As we become more intimately acquainted with God, we love the things God loves and hate the things God hates. When someone offends God, we are offended. We do not seek vengeance or hate our enemies instead of loving them. Verses 19-21 declare that God's friends are my friends an God's enemies are my enemies. IT declares that God's glory and honor are more valuable than even their life. The psalmist does not declare that he will act against God's enemies. He says that he anticipates God's justice. However, God is not only patient with you, he is patient with his enemies. This Psalm is only complete as we read Jesus later saying that he loves his enemies and that we should too (Matthew 5:43-48). In fact, he saved us while we were still his enemies (Romans 5:8).
As we root for God's justice, the psalmist doesn't say, "I'm sure glad I'm not like 'those people,' your enemies." Instead, he knows that evil still remains in himself. We are not heroes. Christ is. The psalmist tells God, "Search me, O God, and know my heart! Try me and know my thoughts! And see if there be any grievous way in me, and lead me in the way everlasting!" (verses 23-24). The psalmist wants nothing more than to have God overcome evil in him so that he will glorify God more. He knows that he is the result of God's grace and patience. In confidence that God leads his children through obstacles, he asks for God's leadership all the more.