Arduino Power Question

Attached is the diagram showing how I hooked up my Arduino and 10k ohm potentiometer to run my Servo motor. I hooked it up powering it with a 9v battery and it worked great. My intentions are to power it with a 12v marine battery (this setup is for my boat), but when I hooked it up to that, boom the board got hot and wont work anymore? I was told this is the correct setup to use if I want to power it from a 12v battery?

Clearly too many volts are getting to the board and frying it? My question is, what if in the positive and negative lines to the battery, I put in a inline voltage regulator (12v to 9v)? Will this solve my problems??

It works great with a 9v battery, and I would just use that but im not sure how long the battery will last powering the board and making the servo run??

Which board gets hot? Arduino? Or the voltage regulator on the breadboard? For the voltage regulator:

going from 9V to 12V, the voltage regulator needs to dissipate nearly twice as much power as the voltage drop increases from 9-5 (=4V) to 12-5 (=7V). So depending on the current that is draw, it will get warm, hot or bloody hot.

I think you’re also missing some capacitors on the input and output of the voltage regulator.