If your compost pile smells rotten, you've upset the balance.
Organics decompose properly only with a carbon to nitrogen ratio of 30:1. Too much food waste (nitrogen) and you'll get a swamp with fly larvae. Too much dry leaves (carbon) and the process will stop.
Ordinary ash will help to correct the situation. Add it to the compost: the alkali neutralizes the acid that causes the stench.

Another secret is aeration. Poke the pile with a pitchfork every week to allow oxygen to penetrate deep. The microorganisms responsible for decomposition die without air.
But there is also an emergency method. Dissolve 100 g of yeast in 10 l of warm water and water the compost.
The yeast will start fermentation, which will "kill" the putrefactive processes. In three days the smell will disappear.
And to make the compost ripen faster, add nettles. They contain silicon, which speeds up the work of bacteria. In a month, you will get a black crumbly mass that smells like forest litter.
But few people know that you can add… hair and animal fur to compost. They are rich in keratin, which decomposes slowly, but enriches the soil with sulfur.
The main thing is to grind them, otherwise the process will drag on for years.
Another less obvious ingredient is cardboard. Tear it into small pieces and mix it with food scraps. The paper absorbs excess moisture and creates structure.
And if the compost is too dry, water it with nettle infusion - this will revive the bacteria.
Fun fact: earthworms speed up maturation by 3 times. Throw them into a pile and they will dig passages, improving aeration. Just don't use chemicals - worms can't stand them.
In six months you will receive a fertilizer that will surpass store-bought analogues.
And remember: compost is not a landfill. Don't throw meat, fats, or diseased plants in there. They will attract rats and contaminate the soil.