why does the cigarette lighter not work when the headlights are on??
This sounds like a wiring problem that will have to be traced using volt meter or continuity tester. There is no reason that the cigarette lighter shouldn't work with the headlights on. Perhaps a fuse is bad, or perhaps there is a short in the system which is disconnecting it.
How to fix cigarette lighter it's not the fuse