This usually refers to burning coal in power-stations. Careful attention to boiler-furnace design and operation, including exhaust gas-scrubbers to remove impurities such as sulphur dioxide, will minimise pollution but any burning any hydrocarbon can only produce primarily carbon-dioxide and water. That is so whether coal, gas or oil.
There is a side problem with sulphur-dioxide removal and so-called "carbon capture". Both may mean cleaner material from the chimney but demand their own power, hence fuel consumption.
SO2 is removed by passing the waste gases through wet calcium carbonate (limestone), creating calcium sulphate. Now, that occurs naturally as the mineral gypsum, so is harmless and in fact useful as the primary ingredient in plaster; but sulphur-dioxide scrubbing needs limestone quarrying, processing and transport, with their own environmental consequences.*
Carbon-dioxide capture usually involved pumping the gas down exhausted oil and natural-gas wells, and it will stay there, but of course involves a good deal of electrical power to drive the plant... hence more fuel!
Good-quality coal can be burnt cleanly in particulate and impurity terms, but does still produce CO2 and we can't change the laws of chemistry!
*So-called "renewable" energy - all only electricity generation and badly-named - raises similar questions as the equipment's raw materials even before manufacture and installation, include petroleum by-products and rare-earth alloys. Their environmental advantage is only in the energy sources for generating the electricity, being non-polluting. In environmental matters, there is no such thing as a free lunch!