Sigmund Freud said this quote

In so doing, the idea forces itself upon him that religion is comparable to a childhood neurosis, and he is optimistic enough to suppose that mankind will surmount this neurotic phase, just as so many children grow out of their similar neurosis.