My Aduino is burned out

I am a total beginner. :cry: I made a program using a hall effect sensor to control two servo motor. when I connect it to my MAC, everything is all fine. like the image below

After that, I did a silly behavior that I connected Arduino with a 12V adaptor. It was okay at first, it worked fine then suddenly I saw a puff of smoke coming out :sweat_smile: :roll_eyes: It is dead.

My friend said that I need to make a resistor to avoid high current but I don't know where I can put the resistor or relay module and how to do it.

You don't need a resistor. Power the Arduino from 5V, which you connect to the 5V pin, or use a 5V phone charger connected to the USB connector.

If you are lucky you might have only damaged the voltage regulator, in which case it might still work on 5V.

It sounds like you tried to power the servos from the Arduino 5V pin while powering it
from 12V on the power jack.

Two things wrong with that: firstly the on-board regulator cannot handle that much
power when dropping 7V, secondly you shouldn't be powering servos or motors from
the 5V logic supply in the first place, but use separate 5/6/7.2V power for the servos
(6 and 7.2V are traditional servo power supply voltages, note, not 5V, so some servos
may have issues with only 5V too).

You were lucky you didn't damage the Mac's USB port in fact.

Motors and servos often put voltage spikes on their supplies - this can destroy logic chips,
or simply make them misbehave and unreliable. Separate power for motors and logic
chips is a very very good idea.

Budget at least 1A per servo for small servos, more for larger ones.

Your Arduino's on-board regulator is probably toast, it may have taken the whole board with
it if you are unlucky, or it may still work from USB (use a powered USB hub though, to
protect the Mac from it).