RPM revs up and down non-stop and now check engine lite. 1998 EX v6

There are a number of things that cause this. That’s why the code is the first step. It very well might point right to it or at least say where to start. Otherwise its all just “well, it could be this…or it could be that…or it could be…”