Translation
I applied my heart to know, to explore and to seek out wisdom and the reason for things, and also to know the folly of wickedness, and of foolishness and madness.
Paraphrase
I applied everything within me to understand, to investigate and to seek out wisdom and the reasons behind things, and also to understand the stupidity of following a wrongheaded path, of foolishness and arrogant madness.