Rough running hyndai sonata
First things first: have someone use a scan tool to check for diagnostic trouble codes (DTC's). If the engine is misfiring, regardless of why(spark plug/fuel injector/ bad camshaft lobe, etc.), a misfire code will be set. These particular codes will begin with PO300. An example is code P0301, indicating cyl# 1, P0302, cyl#2, etc.
Then the diagnostician will need to examine the data for short term and long term fuel trim, oxygen sensor readings, etc. to pinpoint the area needing attention.
The problem could be as simple as a bad spark plug, a bad ignition coil or some other "external" problem.
An engine compression test, a simple diagnostic procedure, will tell you if you have an internal problem, like a bad cam, or valves, or something else which can affect engine compression. I am not familiar with Hyundai having camshaft failure problems. I don't know how many miles you have on your Hyundai, if your under 100,000, I doubt you have internal trouble. You need to make friends with a good auto technician!