Nitrogen comes from your green kitchen and yard waste, and carbon comes from brown waste. You'll need both for your compost.
When looking for nitrogen-rich materials, think of green, fresh, moist items. Include green plants, garden trimmings, leaves, flowers and grass clippings. Eggshells, tea bags, coffee grounds and fruit and vegetable scraps from your kitchen are also good.
Carbon comes from dry garden materials, such as fall leaves and twigs, brown plant material, straw and hay, pine needles and potting soil. Kitchen items include shredded newspaper, bread and grains, nutshells, corncobs and food-soiled paper towels and napkins.
To make gathering compost materials more convenient, keep bags of yard waste near your compost pile and make a temporary home for your kitchen scraps in a compost pail or a designated spot in your freezer. This will help you avoid an excessive number of trips to the compost bin, as well fruit flies and odors inside your house.
Without enough greens, your compost pile will decompose very slowly. Without enough browns, it may smell bad. So, it's important that you have a balance. In general, you can figure that you'll need 25-30 times more brown waste than green [source: Bailey]. If you have a hard time figuring the ratio, it's better to error on the side of too many browns. When determining the right mix, take your cues from your compost pile. If it's mushy, add some carbon. If it doesn't seem to be decomposing much, you'll need to add more nitrogen.