Hyundai Sonata 1999.
RPM suddenly goes
I would check your spark plug wires as well. One could be faulty. But if the RPM's are fluctuating up and down, theres a good chance that the engine isn't getting a consistent air flow. Some things to check are your intake, Mass Airflow Sensor, Throttle body, and air filter. On the intake, check the hose that goes from your air filter to the engine, make sure there aren't any holes or anything abnormal to it. As far as your Mass Airflow Sensor, some times if you go without changing your air filter for a good while, debris and dirt will pile up on the sensor causing it to send incorrect signals to the computer for the engine making it take in too much or too little air to the engine. You can solve this by getting a can of MAF sensor cleaner and following the instructions on the can. BE VERY CAREFUL if you choose to pursue this troubleshooting option because that sensor is very sensitive and can break easily causing you to have to buy a whole new sensor. Buying a new sensor should be a last option after everything else has been tried. As far as the throttle body, make sure that the wire that controls the air intake isn't broken or frayed, which would cause it to operate incorrectly. Additionally, check your Throttle Positioning Sensor, and Idle air control valve. The Throttle positioning sensor tells the computer how much air to allow into the engine when accelerating or idling, and the Idle Air control valve does a similar function by regulating how much air flows through the engine when in idle (rest). And finally your air filter. It's good to change that out pretty much every oil change to maintain a clean airflow to the engine, which is a huge factor to its performance and fuel economy. Further troubleshooting options would involve your spark plugs and spark plug wires, you may have a faulty spark distributor. Its that box that the other end of the wires are connected to, it is what sends out the current to the spark plugs. And after that if it gets this extensive, you may have a problem with your fuel lines or fuel distributor. Most likely it has to deal with air flow because I had to solve a very similar problem on my friend's Mazda Protoge. If you have a check engine light, next time you get the vehicle to start, bring your car to an auto parts store and see if they can read the codes that the computer is putting off that signals what the problem is. It should give you the exact location of the problem with your vehicle.
I hope this bit of information is useful to you, and I wish you good luck.