Compost turns into a black sticky substance if there isn't enough air to aid decomposition. The trouble is many gardeners only add grass clippings and these compact the heap. There are three ways to improve the situation.
Firstly you can partially rot your clippings down before you add them. Spread them out on a plastic sheet after mowing and leave them until they brown: this usually takes a day. Turn them and leave them for a second day. Then add the brown clippings to the heap, or use them as a brown mulch under shrubs, raspberries or trees.
The second method involves adding plain cardboard boxes. These can be ripped up very roughly and mixed among the clippings to create air pockets.
The third method is to add a natural accelerator. If you have a pet rabbit or hamster, or keep poultry, their droppings are ideal. But comfrey leaves also work well and if you plant an upright Russian comfrey (Symphytum uplandicum) close to the heap it can be cut back every few weeks and the leaves added.
Finally cover your heap to keep the moisture in.
Related: composting - what can go wrong?
Composting dos and don'ts
Avoid problems with compost with these dos and don'ts...
Dry out cut grass on plastic sheeting before adding it to the compost heap.
Opt for a wooden bin. The plastic compost bins with lids, though useful in small gardens, tend to exclude air and for this reason I would build or buy a square wooden bin with slatted sides and a removable front. Ideally you should have a bay of three - one to add to, one that's rotting down and one that you're digging.
Add chopped up material when possible because chopped material makes fine, friable compost. A mechanical shredder is useful simply because it creates more air gaps among smaller pieces. You can also shred woody materials.
Add a cover. If you are using an open wooden bin you need a cover to keep in moisture. You can use large cardboard boxes or a piece of old carpet (rubber side down) as a lid.
Water your heap when the weather is very dry.
Be selective about what you add - don't add seeds or roots of weeds, meat or cooked food.
Never add any plant material that looks diseased. Black-spot-affected rose leaves, blackened hellebore foliage, virused plant material, mildew-affected leaves etc are best left off the heap.
Athough hamster, chicken and rabbit droppings make excellent accelerators, dog and cat faeces shouldn't be used. They are too acidic.
Related: how to make a compost heap.