In The Mediations, Descartes determines he can find certainty if he can clear away everything about which he has doubt. What is left standing at the end of this process, he decides, is what he will be certain about. At the end of the process, he determines that the only thing he can be certain about is his own thought: he has what he calls the "clear and distinct perception" that he thinks. From that insight, he comes to the realization that his sense of being comes from his thoughts. As he puts it in a famous formulation, "I think, therefore I am."
The only thing Descartes is certain of is that he thinks. From there, however, he also finds certainty that there is such a thing as a god or Absolute Being, because he determines that he could not think of such a being (which is greater than he is) if it did not first exist.