How can I fix my OBD and warning lamp to pass my smog? on 2002 Saturn SL1

It failed the smog test due to a OBD communication failure and a warning lamp failure. How can I fix these?!

Also because my fuel cap want functional, it seems to seal fine but should i buy a new just to be sure?

Asked by for the 2002 Saturn SL1