As we assemble the previous verses in this chapter up to this point, we can see that David is essentially saying, "Since God knows everything about me, and since it is my desire to be pleasing to Him, may He show me any way that I have been displeasing to Him as it is my desire to be in conformity with His will."
Every now and then it is a good idea to pray something like this to God. Think of it as a time of confession. It is one thing to confess sins we know we have committed but it is another thing to ask God to search us and make it obvious to us of any ways we have been displeasing to Him. David realizes that if God knows all things about him, then He also knows all ways in which he has been displeasing to Him.
Make no mistake about it, a wicked or offensive way stands between us and our relationship to God. Therefore, when we become aware of such way(s) we should follow the formula of 1 John 1:9, "If we confess our sins, He is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness."
The word of God speaks of two opposite ways: the way of the upright and the way of the wicked (see Psalm 1, Proverbs 12:28 and Matthew 7:13-14). God desires for us to draw close to Him and since He knows everything about us, this prayer request is a means of making us aware of the ways that are preventing us from being closer to Him. After all, we may never know what is next until we ask. This is why David ends this Psalm with a continuous request for God to keep working on His life.
There is no better judge or counselor for our lives than a holy God who knows us, and if He knows everything about us, then we should ask God to work with that knowledge about us and lead us down the path He desires for our lives.