Saint (Anselm's of Canterbury's Ontological argument) goes as follows:

Hence, even the fool is convinced that something exists in the understanding, at least, than which nothing greater can be conceived.... And assuredly that, than which nothing greater can be conceived, cannot exist in the understanding alone; for suppose it exists in the understanding alone; then it can be conceived to exist in reality; which is greater.

Therefore, if that, than which nothing greater can be conceived, exists in the understanding alone, the very being, than which nothing greater can be conceived is one, than which a greater can be conceived. But obviously this is impossible. Hence, there is no doubt that there exists a being, than which nothing greater can be conceived, and it exists both in the understanding and in reality.

(Proslogion, ch. 2)
This argument is a reductio ad absurdum: postulate the nonexistence of God, and show that this leads to an absurdity. Perhaps we can outline the argument as follows:

(1) A maximally great being (one than which nothing

greater can he conceived) exists in the under-standing (that is, is such that we can conceive of it).

(2) It is greater to exist in reality than to exist merely in the understanding.

(3) Therefore, if the maximally great being existed only in the understanding, it would be less than maximally great.

But it is impossible that the maximally great being be less than maximally great; hence this being exists in reality as well as in the understanding - that is, it exists And clearly this maximally great being is God.

The earliest objection to this argument was proposed by Anselm's contemporary and fellow monk Gaunilo in his On Behalf of the Fool (Psalm 14: 'The fool has said in his heart "There is no God"'). According to Gaunilo, the argument must be defective, because we can use an argument of the very same form to demonstrate the existence of such absurdities as an island (or chocolate sundae, or hamster, for that matter) than which none greater can be conceived. (Says Gaunilo: 'I know not which I ought to regard as the greater fool: myself, supposing that I should allow this proof; or him, if he should suppose that he had established with any certainty the existence of this island.') But Anselm has a reply: the notion of a maximally great island, like that of a largest integer; does not make sense, cannot be exemplified. The reason is that the properties that make for greatness in an island - size, number of palm trees, quality of coconuts - do not have intrinsic maxima; for any island, no matter how large and no matter how many palm trees, it is possible that there he one even larger and with more palm trees. But the properties that make for greatness in a being -knowledge, power and goodness, for example - do have intrinsic maxima: omniscience, omnipotence and being perfectly good.

Excerpted from, "Arguments for the Existence of God" found in  The Routledge Encyclopedia of Philosophy, Edward Craig ed. Routledge:London, 1998.