Shaking is due to a misfire. The Check Engine light tells you the Engine Computer has detected a problem, most likely related, and has set a diagnostic fault code in memory. Having that code read is the place to start. It will indicate the circuit or system that needs further diagnosis.