When you have black smoke coming from your exhaust while driving it indicates that you are burning too much gas. (i.e. your air/fuel mixture is burning too rich causing the black smoke).
The first thing you should do is to check your air filter to see if it is clogged. Locate your jeeps air filter and remove it. The air filter on a 1997 – 2003 wrangler is located in a black plastic box in the shape of a rectangle. You will need to pop the clips off using a screw driver to be able to open the top.
Take a close look at your air filter. Is it very dirty? If there is a lot of dirt on your air filter then this is the likely cause of your problem. When your air filter is dirty it will not allow enough air through to the engine causing your air/fuel mixture to burn rich causing the black smoke.
You can pick up a new air filter from any auto parts store. Once you have your new air filter in place, replace the cover and reattach the clips.
If Your Air Filter Is Not Dirty
If your air filter is not dirty then your fuel injection system is where we need to look next. One of your sensors could be bad. The sensors that will be the most likely to cause black smoke is your Throttle Position Sensor, Engine Coolant Temperature Sensor and/or The Mass Air Flow Sensor.
Unfortunately you will not be able to tell if any of these have gone bad just by looking at them. You will have to take your jeep into an auto shop and have a mechanic hook your jeep up to an engine analyzer. This will tell you if there are any problems with your fuel injection sensors.
If the engine analyzer finds one or more of these sensors to be faulty, have the mechanic replaced them and you will then be on your way.