Descartes engages in radical skepticism in his Meditations. Here, he wonders about the extent of what he knows and sets a criteria for himself: he cannot say that he knows anything that he possibly can doubt. Although we often come to know things through our senses, he can doubt all of these pieces of knowledge. He could, for instance, be dreaming, and his senses are often mistaken. One thing that he cannot doubt, however, is that he exists in some way. Indeed, if he did not exist, he could not be around to have these thoughts. So, he knows that if nothing else, he is a thinking being. This fact, he believes, cannot possibly be refuted, even if he is the only real thing in existence (solipsism).
However, present in his thoughts is the belief in a perfect God. Where could this idea have come from if a perfect God did not exist? Descartes himself is not perfect, and so the idea of perfection must come from elsewhere. Descartes likens this to a fire and something warmed by the fire—while something may receive heat from a fire (here, radiating heat is perfection), the heat itself does not derive from the object, but from the fire (the fire, then, is God).
If God exists and is perfect, God would certainly not deceive Descartes into believing that his surroundings are real when, in fact, they are not. Thus, Descartes can claim to know the world around him through his senses. However, Descartes admits that sometimes his senses are faulty—this is because they are not perfect. They are simply designed to help him navigate the world. The mind, however, is able to have these thoughts of perfection and thus can arrive at universal truths. It is through our mind, and not our body, that we arrive at truth, a fundamental believe in the epistemological stance of rationalism.