That sounds like a problem with the ignition coil, or the ignition module located on the side of the distributor, and you can remove the ignition module (requires a special tool available from most auto part stores) and most auto part stores will test the ignition module for free.
Also, remove the distributor cap and inspect the connector for the ignition module inside of the distributor from the pick-up coil/stator and the connector should be white as shown in the image here and notice how white the connector looks, when it looks dark or burnt looking then either replace the pick-up coil coil/stator at the same time as the ignition module, or replace the entire distributor. (If you replace the distributor first note how the distributor housing is positioned, and do not forget to mark where the ignition rotor is pointing before, and after you pull the distributor up, that way the distributor will drop right back into place, and re-position the distributor housing as close you can get it to the way the original one was positioned that way the engine should start right up and then just follow the set timing procedures for the vehicle and the timing specifications should be listed out on the emission
label under the hood, and be sure not move, crank, or rotate the crankshaft until the distributor is installed back into the engine)
If you are replacing the ignition module only, be sure that if that ignition module is supposed to have a silicone grease or a die-electric compound that it does come with the ignition module, because it is a heat sink and the ignition module will burn up without it. Also be sure to completely coat the entire metal contact surface
of the ignition module with a thick coat of the silicone grease or die-electric compound and do not leave any of the metal contact surface un-coated, and be careful not to over-tighten the ignition module or it can be damaged. Some ignition modules have a gel film on the contact surface and do not require any silicone grease or die-electric compound.
Ignition pick-up coil/stator, notice now white the connector for the ignition module is, check your connector and if it is dark or burnt looking then replace also replace the pick-up coil/stator with the ignition module, or replace the entire distributor.
Image of ignition module.