A. Open the front panel of the water heater and air blow the heat exchanger with an air compressor to remove if there is any debris or clog inside. After, set the gas knob to minimum and water knob to maximum and start the water heater and check if the black smoke will be gone.
B. If the issue still persist unplug the gas line and stop using the water heater. Call for service.