Reverse polarity is one of the most common causes of circuit failure, from hobby projects to industrial systems. The good news is that a well-designed reverse polarity protection using MOSFET ...
I programmed it with ESPHome, and it only took a few hours from start to finish.
They're reference designs for a reason.