Start with what you can see and smell
Healthy compost is dark, crumbly, and smells earthy. It should feel damp, like a wrung-out sponge, and it should slowly shrink and darken over time. When something is off, the cause is usually one of a few things: too much water or too little, too many wet greens or not enough dry browns, too little air, a pile that is too small, or food that is drawing animals.
Common problems and what to try
The pile smells bad. A sour, ammonia-like, or rotten-egg smell usually means the material has gone short of air. That often happens when the pile is too wet or packed down, or when it has too many food scraps. Mix in dry browns such as shredded leaves or torn cardboard, turn the pile, and pause new food until the smell fades. If you keep asking why does my compost smell, the answer is almost always moisture and balance.
The pile will not heat up. Small piles, dry piles, and piles short on nitrogen often stay cool. A cool pile still breaks down, only more slowly. If you want more heat, build a bigger pile and balance greens and browns.
The pile is too wet. Slimy, dripping, or matted material needs dry browns and more air. Keep rain off it and hold back on wet kitchen scraps until it dries.
The pile is too dry. Dusty, light material that does not shrink needs water. Wet it while you turn it, and add some fresh greens.
Fruit flies appear. They lay eggs in exposed food scraps. Bury scraps under a thick layer of browns, keep kitchen containers covered, and empty them often.
Rats or mice move in. Animals are drawn to food they can reach, especially meat, dairy, and cooked food. Bury scraps, leave those foods out, and line the bin’s base and walls with fine hardware cloth.
Compost takes too long. Large pieces, poor mixing, and an imbalance of moisture or greens all slow decomposition. Chopping and turning help. Expect a slow pile to take a long time, not a few weeks.
White growth appears. Fuzzy white or gray growth on the surface is usually a sign of active decomposition by fungi and bacteria such as actinomycetes. It is generally harmless, and turning the pile mixes it back in.
Worms die in a worm bin. Causes include bedding that is too wet or too dry, temperatures that are too high or too low, too much food, and acidic scraps. Check the bedding, cut back on feeding, and keep the bin in a cool, shaded spot.
A simple order to work through problems
Check moisture first, because it affects almost everything else. Then check the balance of greens and browns. Then check the size of the pile and how much air it gets. Change one thing at a time so you can tell what actually helped.
If you are still at the start, the basics of how to start a compost pile at home will help you build a pile that avoids most of these problems in the first place.