I’m no mechanic but often crawl underneath my vehicles doing basic maintenance and often need to use flashlights to look at tight spaces (i.e. oxygen sensor connectors hidden out of sight not easy to get to). I have a few of these cheap COB lights w/ magnetic tails that you can place in tight spaces, similar to these:

I find wearing a hat gets in the way when working under the car…