So a year ago or so my headlight had to be glued and hardwired in by a mechanic so I can’t replace my headlight without figuring out how to get it out. It’s been a pain. Image is below.
Gluing and hard wiring would have been a last ditch patch.
Now you’ll need to replace the whole assembly.
Get a replacement headlight assembly from a scrap yard along with the electrical connector so the bulb can be replaced.
Tester
You can try removing the assembly and hitting the bulb with a heat gun. Replacement connectors are readily available for most bulbs.
Oh, and find another mechanic who won’t butcher your car.
The wire retainer for the bulb appears to be damaged, time for a new headlamp assembly.
Seems like that would be the easy way. Either new, after-market, or junk yard as tester suggested. I did buy the connector for mine at NAPA if that is also needed. I think around $5.
What year? A headlight assembly is around $100 for a 2009 Mazda 3 on Rockauto.
I have ordered several mirror units from Rock and the after-market were direct fit and exact match to original. Not necessarily the cheapest offered so read the descriptions depending how fussy you are.