Søren Kierkegaard said this quote

to have faith is precisely to lose one's mind so as to win God.