There is a bucket to be cleaned, which is now nearly full of putrid water. It has been left alone for a good time. There may be various ways to go about it.
One of them is to put it under a tap of running water, and just leave the tap to run unsupervised. At first, the jet from the tap carries some of the top layers of dirty water out with itself. But after a little time, the upper part of the bucket consists mainly of fresh water, which just comes in from the tap and directly spills out over the sides. The deeper layers may be relatively undisturbed for a very long time.
The second main way is to empty the whole bucket of dirty water down the drain, then scrub the inside of the bucket, and then rinse it with the pure water. That gets it really clean.
The mind can be taken as the bucket of water, dirty with traces of past impressions of almost pointless distractions and involvements. They often become putrid. If there is a realization of the pointless suffering that is caused, a repentance or even a dramatic conversion perhaps, then the usual prescription: do good and keep on doing good actions and having good thoughts as far as possible. The expectation is that ultimately the whole mind will be purified down to its very depths. It corresponds to the running tap of pure water: it does produce considerable changes in the upper layers of the mind, but it takes much longer to reach the deep levels, if indeed they are ever reached. History shows how people of great virtue and bravery were swept away by uncontrollable impulses from deep within them though they knew the results would be disastrous. An almost incredible example is the fact that when Jerusalem was besieged by the Romans, fighting broke out among the heroic Jewish defenders themselves about a points of doctrine, among them whether it was right to fight on the Sabbath. And the holy city fell.
The other main method is to practise a certain class of meditations, for instance on empty shining Space, till the mind becomes empty of thoughts. The thoughts have been emptied out, so to say. When the mind-bucket has been thus emptied, it is scrubbed with the wire brush of the dynamic latent impressions (not thoughts) of desirelessness. For most of us, the process is not completed in one operation, and has to be done again and again. The first step is to prepare the scrubbing brush by a controlled life, to lay down the impressions of freedom from illusory desires. Next comes emptying the mind-bucket by meditation. In some schools, the emptying practice is pictured as releasing the little thought-fishes into the infinity of the ocean of God. Then the impression-brush spontaneously works to clean away residual traces. In any case, the process is repeated till it begins to become natural, and takes place of itself.
In some teaching lines there is an oral tradition that as the mind becomes pure, then even in active life there is a sort of inner background, so that experiences, actions, and thoughts take place under something like a clear blue sky. In Zen this is regarded as a particularly favourable sign.