Hello, The headlights do not really have anything to do with the check engine light.The first thing to do is to retrieve the codes from the computer.Most parts stores do this for FREE so they can sell you a part.Get the codes and post back and we can help.The codes will isolate the problem to a specific circuit to be diagnosed.
__________________
"It is much wiser and cost efficient to ask a question
than to stumble blindly through your auto repairs".Please Click Accept if my answer was helpful.