98 Hyundai Elantra that is running rough you are getting check engine codes that say there is a problem with the camshaft position and code that say their are random misfires Any ideas?

A bad camshaft position sensor will cause a engine to run very rough or not run at all. Replacing the camshaft sensor is very complicated.