Hume begins by distinguishing between impressions and ideas. Impressions are sensory impressions, emotions, and other vivid mental phenomena, while ideas are thoughts or beliefs or memories related to these impressions. We build up all our ideas from simple impressions by means of three laws of association: resemblance, contiguity, and cause and effect.
Next, Hume distinguishes between relations of ideas and matters of fact. Relations of ideas are, for the most part, mathematical truths, so denial of them would result in a contradiction. Matters of fact are the more common truths that we learn from experience. Denying a matter of fact is not contradictory.
For the most part, we understand matters of fact according to cause and effect, where a direct impression will lead us to infer some unobserved cause. For instance, I know the sun will rise tomorrow based on past observations and my understanding of cosmology, even though I have yet to observe this fact directly.
Hume suggests that we cannot justify these causal inferences. There is no contradiction in denying a causal connection, so we cannot do so through relations of ideas. Also, we cannot justify future predictions from past experience without some principle that dictates that the future will always resemble the past. This principle can also be denied without contradiction, and there is no way it can be justified in experience. Therefore, we have no rational justification for believing in cause and effect. Hume suggests habit, and not reason, enforces a perception of necessary connection between events. When we see two events constantly conjoined, our imagination infers a necessary connection between them even if it has no rational grounds for doing so.
Our inferences regarding matters of fact are ultimately based in probability. If experience teaches us that two events are conjoined quite frequently, the mind will infer a strong causal link between them.
All meaningful terms, Hume asserts, must be reducible to the simple impressions from which they are built up. Since there is no simple impression of cause and effect or of necessary connection, these terms might appear meaningless. Rather than condemn them entirely, Hume simply reduces their scope, suggesting that there is nothing in them that goes beyond an observation of constant conjunction between two events.
Hume turns these conclusions toward a compatibilist view of free will and determinism. If we perceive no necessary connection between events, we needn't worry that all our actions are causally predetermined. Rather than view free will as the freedom to have done otherwise, we should view it as the freedom to act according to one's own determinations, which is true of everyone but prisoners.
Near the end of the Enquiry, Hume follows a number of tangential discussions, arguing that human and animal reason are analogous, that there is no rational justification for a belief in miracles nor for the more speculative forms of religious and metaphysical philosophy.
While a skepticism regarding necessary connection and the existence of an external world is justified, it destroys our ability to act or judge. The instinctual beliefs formed by custom help us get by in the world and think prudently. As long as we restrict our thinking to relations of ideas and matters of fact, we should be fine, but we should abandon all metaphysical speculations as superfluous and nonsensical.