“If God does not exist, everything is permitted.”

Fyodor Dostoevsky The Brothers Karamazov, Book V, Chapter 3, paraphrase (trans. McDuff) — commonly attributed but the exact phrasing varies