How Epicurean Metaphysics leads to Epicurean Ethics
1. The Epicurean position in metaphysics is materialistic.
Their particular form of materialism is known as "materialistic atomism," which is the doctrine that all reality consists of indestructible material elements called "atoms" which move through empty space, "The Void." Atoms interact by collisions according to deterministic mechanical laws. In the beginning all atoms "rained" downward in parallel paths, but some occasionally swerved from these paths (Epicurus doesn't say why) setting up chain reaction collisions which led to the clumping of atoms into the physical objects which form the natural world from stars and planets to human bodies.

2. The Epicurean position in epistemology is empiricistic.

Since humans are nothing more than giant collections of atoms which can interact with other objects only through collisions between material atoms, knowledge for epicureans simply is sensation. Sensation in turn is nothing more than the collisions between atoms and human sense organs, which of course themselves are just other bunches of atoms.

3. The Epicurean position in ethics is hedonistic.

Since all we can know are our sensations, amongst which are the sensations of pleasure and pain, the Epicureans considered that ethics, or what might be thought of as "how to live a virtuous (i.e. "good") life" is in effect just learning how to maximize pleasure and minimize pain. Thus Epicureans are hedonistic consequentialists: ethical value lies in the consequence of an action, specifically, whether it maximizes pleasure and minimizes pain.

4. The Epicurean psychology assumes psychological hedonism as a theory of human motivation.

Epicurus takes it for granted that humans are motivated to maximize their own pleasure and minimize their own pain. He adds to this the ethical hedonistic doctrine which asserts that they ought to so act. So we are in fact motivated by a desire for our own happiness and we oughtto be so motivated.  The problem for Epicurus, therefore, becomes  knowing how to achieve this hedonistic end of maximizing my pleasure and minimizing my pains.
5. The Epicurean analysis of pleasure and "desire":
Epicurus deduces from his hedonism that the pleasures we ought to pursue must be pure and not admixed with pain. Since pleasure is the sensation which occurs when desire is satisfied and the satisfaction of different desires yields different kinds of pleasures (and pains), the trick to maximizing pleasure and minimizing pain becomes in effect knowing what we ought to desire.
6. Psychological hedonism implies some desires are natural.
From his analysis of human motivation, Epicurus concludes that desires can be divided into "natural" (arising from human nature) and "unnatural" (acquired as part of one's society). Unnatural desires, such as the desires for power or fame or wealth, lead to pleasure which are very impurely mixed with inevitable pains. Hence these desires are to be shunned. Of "natural desires" some are "necessary" for maintaining life (the "bare necessities"), while others are "unnecessary" for survival, but nevertheless natural (e.g. sexual desires). Fortunately natural and necessoppary desires are relatively easy to satisfy. Their satisfaction would produce the life most free of impure pleasures mixed with pain. Notice that this is almost the opposite from that often associated with the word "epicurean" today, which is a life of highly unnatural unnecessary pleasures, i.e. "wine, women, and song!"

7. The ideal state for the believer in Epicurean ethics would be a life of simple quiet pleasure.

Of the natural necessary pleasures, Epicurus considers those of "repose" or "tranquility of soul" which arises from being free of unnatural and unnecessary desires as the highest pleasure attainable. In Greek this state was called "ataraxia" and was regarded as the ideal of life, the attainment of which gives every act its moral value. This life would be filled with the simple pleasures of a wholesome diet, environment, and only the necessary creature comforts for sustaining a quiet life, lived with close friends. In many ways it is reminiscent of the monastic ideal of the middle ages or the back-to-nature movement of the hippie days.
8. "Ataraxia" demands minimizing pain.
Hedonism also includes the minimizing of pain. Epicurus argued that a good clean life will, with luck, be relatively free of sickness and suffering of physical pain. But he regarded the primary "pain" to be anxiety over two "fears": a) fear of death and b) fear of the gods' anger. To these he replied that we should not fear death because the only evil is pain, which is a sensation, and after you're dead there is no more sensation. We need not fear the anger of the gods because the gods are perfect beings, and hence live lives of "ataraxia". If they were to intervene in human lives, it would disturb their divine ataraxia.

9. The Problem with Epicureanism:

Despite its popular appeal in ancient times and the return of similar doctrines in later centuries, unfortunately Epicurean metaphysics is inconsistent with its ethical theory. Atomism is deterministic, but its ethics is normative. That means Epicurus holds a view of reality which says in effect humans are nothing more than vast collections of material atoms all which behave according to deterministic laws. His psychological hedonism is a consequence of this determinism. In other words he holds that what we are determines us to seek to maximize our pleaasure and minimize our pains. Thus human free will is an illusion. Really all our actions are just as determined as the motions of billiard balls on the billiard table. If this is the case, it makes no sense to say to someone that he should pursue natural necessary pleasures and should shun unnatural ones, for he is determined to do exactly what he is going to do from the start. All normative "preaching" about what people should or should not do is useless.
10. Epicurean ethics recommends withdrawal.
The Epicurean attitude towards involvement with public affairs was that it disrupts ataraxia or tranquility of soul. There is no doubt that the "crusader," the person who tries to change the world to make it a better place, is not likely to find much tranquility or repose. Thus Epicurus recommends withdrawing from the world and its problems. True to his egoistic hedonism, Epicurus considers "the world and its problems" are not his problems and counsels no involvement with it. This is not a doctrine to produce revolutionaries or saints and martyrs.