In part four, the most important part of the Discourse, Descartes describes the results of his meditations following the method he previously laid down. Whereas he had earlier undertaken to act decisively even when he was uncertain, he now takes the opposite course, and considers as false anything that is at all doubtful. This way, he can be sure that he holds on only to things that are indubitably certain. He abandons all sensory knowledge, since the senses can deceive, all demonstrative reasoning, since people often make errors in their reasoning, and imagines that everything that has ever entered his mind is just illusions brought on by dreams.
Even in doubting all this, however, he observes that he must be something in order to doubt. This doubt requires thought, and this thought confirms his existence, so he adopts the principle "I am thinking, therefore I exist," as the indubitable foundation upon which he will build. Since his knowledge of his existence hinges exclusively on his thinking, he concludes that he is essentially a thinking substance, and that his soul is totally distinct from, and easier to know than, the body.
In considering how he knows that "I am thinking, therefore I exist" is true, he notes that there is nothing persuasive about the proposition in itself, but that he sees clearly and distinctly that it is necessarily true. He thus adopts such clear and distinct perceptions as the guarantors of truth.
While it is possible that thoughts of external objects like the sky, the earth, light, and so on are all delusions of the mind, Descartes asserts that the same is not possible of God. These other thoughts are of imperfect objects, so they could easily be invented by an imperfect mind. However, it is inconceivable that Descartes's imperfect mind could invent the idea of a perfect God: that would mean that the existence of a perfect being depended on an imperfect being. Descartes concludes that God is a perfect mind, and that all the perfections in himself and in other bodies are due to God's perfection.
Descartes arrives at another proof of God's existence by way of geometry. He notes the certainty with which geometers can prove facts such as the fact that the angles in a triangle add up to 180 degrees. This is part of the essence of a triangle, and yet for all that, there is no assurance that one triangle actually exists in the world. When contemplating God, however, he recognizes that existence is as much an essential property of God's as having three angles that add up to 180 degrees is an essential property of triangles. God's existence is thus as certain as a geometric proof. Descartes remarks that people have difficulty with these proofs because they rely exclusively on their senses and imagination. God's existence can only be perceived by reason, and not by these other two faculties.
In fact, God's existence is more certain than anything else, since all other things are subject to the doubts that Descartes has already raised. These doubts can only be removed by the recognition that God exists. Thanks to God we can be assured that our clear and distinct perceptions are true, since those perceptions come to us from God, and we can rest assured that all our perceptions must be true to the extent to which they are clear and distinct. We perceive clearly and distinctly when we exercise our reason properly, and we are misled when we rely exclusively on our senses or imagination.