Have the right mix of "browns" and "greens" in your bin. The rule of thumb is 3 "browns" to 1 "green." Browns are your carbon source, which would be like dried leaves. Greens are things like fresh grass clippings, and that is your source of nitrogen.
If you are composting food scraps, be sure you are only composting raw fruits, vegetables, and other compostable waste like coffee grounds or egg shells. Do not compost meat, fats, oils, greases, or pet waste.
Water your compost pile. Keeping it about as wet as a wrung out sponge will help your compost bin work.
Turn your pile after 4 to 5 weeks at least. Turning the pile helps colder areas of your pile compost, and prevents unwanted critters from making their home in your compost pile.