In meditation 3, Descartes argues that God is an infinite substance. By "substance," he means that which doesn't rely on something else for its existence. Unlike humans, plants, trees, animals, rocks, and flowers, God wasn't created by anything or anyone else. Strictly speaking, only God falls into the category of substance. But Descartes also argues that human beings are finite substances in that they depend for their existence on nothing but God.
As well as being infinite (something that has no limits), the divine substance that we call God is also eternal, immutable, independent, supremely intelligent, and all-powerful. That being the case, Descartes argues (in a variant of the ontological argument), as finite substances, human beings cannot possibly have come up with the idea of an infinite God. Therefore, he concludes, God necessarily exists.
The same applies to all God's other attributes, such as supreme intelligence and limitless power. No human being is all-powerful, supremely intelligent, eternal, immutable, or any of the other divine attributes, so we can only conclude that these concepts must have come from somewhere. As these ideas could not have originated with ourselves, for the reasons just given, then one must conclude that they were put into our minds by God.