This is vividly explained in the following Slokas: -
Burning fire reduces the wood to ashes; even so does the fire of knowledge reduce all action to ashes.
There is no purifier in this world like knowledge; he that perfects his practice of selfless action finds that knowledge in himself in due time.
The man who while acting yokes his action to renunciation, who has destroyed doubt by knowledge, and who is ever watchful over himself, actions do not bind.
Therefore, with the sword of knowledge destroy this ignorance-born doubt that dwells is your heart, and stand up, established in Yoga.