A candle produces soot when it does not burn cleanly. This can happen if the wick is too long, the wax is of poor quality or there is not enough oxygen for the fuel (which is paraffin in most candles) to burn completely.
To minimize soot formation , it is important to trim the wick to 1 cm before lighting, burn the candle in a well-ventilated room and use high-quality, unscented candles.