Try the gas cap first it's free.
Than I would unplug the ECM for 30 seconds to reset the codes in the computer. If the check engine light comes back on in say 30 seconds I would go to Autozone for a free scan test and you will know what's wrong. Then fix it.