Rene Descartes opens the Meditations on First Philosophy with a project that sounds almost reckless: doubt everything that can possibly be doubted, including the reliability of the senses, the existence of the external world and the difference between waking and dreaming, and see what if anything survives. What survives, Descartes argued, is the doubting itself. He cannot doubt that he is doubting without thereby thinking, and he cannot think without existing as the thing doing the thinking, which is the reasoning behind his famous conclusion that he exists as a thinking thing even if everything else he takes for granted turns out to be false.
From that single certainty Descartes tried to rebuild everything else, and the next step matters most for religion. He argued that among his own ideas is the idea of a perfect, infinite being, and that an imperfect, finite mind like his own could not have generated that idea on its own, since an effect cannot contain more reality than its cause. The idea of God, Descartes concluded, must have been placed in him by an actually existing perfect God, and that same non deceiving God then guarantees that his clear and distinct rational perceptions, arrived at carefully, are trustworthy after all. Spinoza and Leibniz inherited Descartes's confidence that reason alone, followed rigorously, could reconstruct reality's basic structure, but neither kept his God: Spinoza identified God with nature itself, and Leibniz argued for a world of countless individual substances God had coordinated into harmony from the start.