Look around the room. You probably see a desk, chairs, and some books. You believe that all these things exist. Moreover, you believe that they exist in such a way that corresponds to your perception of them. If someone told you that, in fact, nothing in the room existed except for you, you would dismiss this person as a lunatic. This is because you are not a skeptic. You believe in the real existence of the objects of your experience. Berkeley would applaud you; according to his philosophy, you have common sense.
But there is probably also something else that you believe about the things in your room. You believe that they exist independent of any perceivers. That is, you think that, even if there were no one at all perceiving these things, they would continue to exist. You think that they are independent of human minds. This is where Berkeley would disagree with you. In fact, he goes so far as to say that your commitment to this belief runs counter to common sense. This is because he thinks he can show that your commitment to the existence of mind- independent objects will lead you to reject the above two common sense commitments that you and he share: that desks, chairs, books, etc. really exist and that they exist in such a way that corresponds with our perception of them. His mission in the Three Dialogues is to prove this to you.
Berkeley breaks his book up into three separate sections, or dialogues. In the first dialogue he tries to demonstrate that materialism — or the belief in the existence of mind-independent material objects — is incoherent, untenable, and leads ultimately to skepticism. In the following two dialogues he attempts to build up his own alternative worldview, immaterialism (now known as idealism). According to this view all that exists in the world are ideas and the minds that perceive them, including the infinite mind that contains all else, namely God. In the second dialogue he lays this picture out, and in the third he fills in some details and defends it against possible objections.
In broad outline, Berkeley's argument against materialism goes like this: (1) If we perceive mind- independent material objects, then we either perceive them immediately (through our senses) or mediately (by inferring them from what we immediately receive through our senses). Berkeley believes in this claim because he is an empiricist, that is, someone who believes that all knowledge comes through the senses. If the only way we have of getting knowledge is though the senses, then these really are our only two options for coming to know about mind-independent material objects. (2) We do not immediately perceive mind- independent material objects. (3) We do not mediately perceive mind-independent material objects. (4) We have absolutely no reason to believe in the existence of mind-independent material objects. The conclusion of this argument is not that mind-independent material objects do not exist; it is that we have no reason to believe that they exist. Berkeley thinks that this conclusion is strong enough; if we have no reason to think mind-independent material objects exist, then we should not believe that they exist. However, Berkeley does think that several of the arguments he uses along the way, in order to prove the second and third premises, actually do show conclusively that mind-independent material objects cannot exist.
Prominent among this latter group is an argument that has come to be known as the Master Argument. This argument is intended to show that the very idea of an object existing outside of the mind is inconceivable. It is impossible to conceive of an object existing without the mind, goes the argument, because the second you try to do so, the object is in your mind. Just by trying, in other words, you fail! This is actually a terrible argument, and some philosophers go so far as to say that it is no argument at all. (The Australian philosopher David Stove likes to call it "the Gem".) Nonetheless, it has been widely influential in the history of philosophy, and Berkeley himself seemed to like it a great deal.
After undermining the claims of materialism, Berkeley next moves on to present his own immaterialist picture. According to this view, real things, things like desks, chairs, and books, are just collections of ideas that exist in the mind of God. God sometimes exhibits these to us, and we experience them as sensations. God exhibits these sensations to us, moreover, in certain patterns. For instance, whenever we have the sensation "seeing fire" it is accompanied by the sensation "feeling heat". We call these patterns the "laws of nature". When we engage in science it is these patterns among ideas that we are uncovering.
Berkeley believes that his worldview has many advantages (for instance, it makes physics a lot less complex), but two of these stand out from among the rest as being of paramount importance. First, his view does not allow atheism; Since our ideas need to exist in the mind of some infinite perceiver there needs to be a God. Second, the view is equally immune to skeptical doubts. If what it means for a desk to exist, is just that is perceived, then we can never worry that the desk we are seeing does not really exist. Further, since there is nothing to the desk above and beyond our sensation of the desk (the desk just is that sensation) we do not have to worry about whether appearances and reality match up. Appearance just is reality. Because his theory is immune to skepticism, he feels that he can call his view — a view on which nothing exists outside of minds — the view of common sense.