When composting, we are just accelerating the natural decomposition of plant material. By controlling the environment of the compost pile you can determine how fast or slow you complete the compost process. There are four basic ingredients in the compost pile: nitrogen, carbon, water, and air.
Nitrogen - Green materials such as grass clippings, fresh leaves and twigs, vegetable and fruit trimmings, coffee grounds and filters, and non-meat eating animal manures (chicken, rabit, horse, sheep or goat). Most any plant material that has moisture or "life" still in it is considered a green material.

Carbon - Brown materials that have released their nitrogen are usually dry and brittle. Dry leaves and grasses, straw, wood chips, corn stalks, shredded newspaper, paper towels, napkins, and cardboard are all good carbon rich examples.

Water - Adding water to the pile will balance the correct moisture level. The proper moisture should be about the same as a damp wrung out sponge. Few drops should fall when the material is squeezed in your hand.
Air - Oxygen is very important to the organisms that are working in the pile to break down the organic material. Bacteria, fungi, microorganisms, and insects need oxygen to breathe and air space in which to move througout the pile.
Avoid These Items
There are ingredients that you will want to avoid in the compost pile. They can create odors or attract unwanted pests, or have pathogens that won’t be broken down by the heat of a compost pile.
Don’t put any meat, dairy products, fats, or oils into the compost pile. These materials tend to putrefy instead of breaking down, and will attract a wide variety of pests, including flies, rats, raccoons, stray dogs and cats, etc.
Don’t put dog and cat wastes into the compost pile. The fecal material from any animal that eats meat contains several pathogens which will survive the compost process.
Don’t put thorny plant material in the compost pile. The thorns might not break down completely and you could get stuck when you are digging in the garden or compost pile with your hands.
Don’t add diseased plant material in the pile. The disease may not be killed by the heat of the pile and transfer to other plants when you use the finished compost in the garden.