"Behold, thou desirest truth in the inward parts: and in the hidden part thou shalt make me to know wisdom. . . . Create in me a clean heart, O God; and renew a right spirit within me" (Psalm 51:6,10).
"Garbage in, garbage out" used to be an admonishment to computer operators when the data processing field was just getting started. In like manner, the new or even not-so-new Christian comes to learn that what he takes into his sensory system is what comes out, eventually. The way he thinks and behaves is modified by the experience he has gained.
The psalmist recognized this dilemma and reminds us that our Father desires truth inside our frame, in our minds. We know, however, that much error enters our minds and affects our activities. It does not lead to wisdom and is the basis for an unclean heart (mind), eventually manifesting itself in improper action-sin. The solution is to ask the Father to place a right spirit within us (v.10), replacing the spirit of rebellion and error, so that we can be "whiter than snow" (v.7).
Remembering that this psalm was written by David "when Nathan the prophet came unto him, after he had gone in to Bathsheba" (Psalm 51 superscript), notice that the steps which must be taken are recognition that a change must take place, asking for the transformation to be made, and lastly, allowing the right spirit to flow into our minds.
Having decided to make a change, we can be certain of the outcome. Our heavenly Father promises that "If we confess our sins, He is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness" (I John 1:9).
This is serious business involving our entire beings. "Be not conformed to this world: but be ye transformed by the renewing of your mind, that ye may prove what is that good, and acceptable, and perfect, will of God" (Romans 12:2). KBC