In this meditation, Descartes is seeking to establish a foundation for knowledge that is beyond any doubt. He argues that we should doubt all of our beliefs that are not absolutely certain, and he eventually arrives at the conclusion that the only thing that is beyond doubt is the fact that he exists as a thinking thing.
From there, he reasons that he could not have come into existence on his own – there must be some cause or reason for his existence. He concludes that the cause must be a being that is greater than himself, and that possesses all of the attributes and perfections that he can conceive of – including things like omnipotence, omniscience, and infinite goodness.
Descartes argues that since it is clear and distinct that such a being exists, and since he himself is a finite and imperfect creature, he can only know with certainty those things that are revealed to him by this perfect being. Therefore, the certainty and truth of every science depend exclusively on the knowledge of the true God, since he is the source of all our knowledge and understanding.