Your lights dimming might be result of low idle.

There are a million things this could be....you're going to have to provide more information and do more detective work.

Start with the basics:

1) Pull and inspect the plugs
2) Check the air filter and fuel filter
3) Check the throttle body for large amounts of carbon buildup
4) Check for other rudimentary problems (broken vacuum lines, broken wires, leaking fluids etc)