In the philosophy of Descartes, systematic doubt can lead to one kind of certainty and one kind only: that I exist. Everything else can reasonably be doubted, such as the existence of the empirical world around me. But the fact that I exist is indubitable. In developing this crucial point, Descartes uses what has become a well-known thought experiment.
Suppose some evil demon comes up to me and tries to persuade me that I don't exist: that I'm nothing more than an elaborate mirage. Descartes argues that, no matter how hard he tries, the demon will never be able to convince me that I don't exist. Why? Because even if the demon is trying to trick me there still has to be someone for him to trick. In other words, you can't trick something that doesn't exist. So if an evil demon should tell me that I don't exist, then I know for certain that he's lying. I know for certain that I exist.
To be sure, the evil demon can convince me that the objective world—the world of rocks, stones, planets, and trees—doesn't exist. But that still leaves the self untouched. Systematic doubt, though providing the very foundations of Descartes's methodology, reaches its limit in the thinking self.