The brief
The A4 had a confusing set of symptoms: black smoke from the exhaust, the check engine light on, and a warning that the engine was overheating. He brought it in. When black smoke and a phantom overheating warning turn up together, a faulty coolant temperature sensor is a prime suspect. That sensor tells the engine computer how hot the coolant is, and the computer uses it for the fuelling and feeds it to the temperature display. When the sensor goes faulty and reads wrong, the computer can think the engine is stone cold and over-fuel it, which is the black smoke and the trouble code, and the display can show a wild reading like an overheat that isn't real. A faulty sensor doesn't recover, so it needs replacing, and the cooling system checked to confirm the engine itself is fine.
The diagnosis
A diagnostic scan pulled the fault to the coolant temperature sensor, the reading erratic and not to be trusted, which is exactly what would cause the over-fuelling, the smoke and the false overheat warning. A check of the actual coolant temperature with a separate tool confirmed the engine itself was running at the right temperature, no real overheat, no coolant loss, the cooling system sound. That's a sensor replacement, you don't repair it, so the call was a new genuine sensor, fitted and the codes cleared.
The work
The old coolant temperature sensor was removed, the seating cleaned up, and a new genuine Audi-spec sensor fitted with a fresh seal, the small amount of coolant lost topped back up. The fault code was cleared and the engine's fuelling adaptations reset so it could relearn against a sensor reading the real temperature. A road test confirmed no black smoke, the check engine light off, the temperature display reading correctly, and the engine running clean.
The outcome
No black smoke from the exhaust, no warning light, the temperature display reading the real engine temperature, and the running back to clean. The A4 went home with the fault sorted. A faulty coolant temperature sensor makes the engine over-fuel and the dash lie about an overheat that isn't there, so changing the sensor and letting the engine relearn put the running right and cleared the alarm.