I have a 98 civic that dies while driving and the check engine light comes on. I let it sit and turn it back on and the light goes off until it happens again. It’s not throwing any codes. What would the problem be?

on those, often a bad distributor does that. if it loses spark, replace the dist with an aftermarket new dist, don't try a cheap rebuilt.