Arduino Nano stops working completely

Hi all,
I'm new to Arduino I hope I have chosen the right Forum topic please help.
I am having trouble with Arduino Nano board, every time I connect a external 12v power source to Nano with 3x 18650 batteries on Vin pin for my project the Nano board starts up fine.
When I use it to activate my project it stops working completely.
When you plug usb cable in the light powers on but no longer works with Arduino IDE but it still recognises COM Port.
If it helps you understand why its doing this then I should mention,
I have a 12v motor connected to a relay. The Nano activates the relay to power on the motor.
I'm using the same power source to power the Nano and Motor.
Before connecting the 12v to the Nano I tested it before putting it together and I used a 5v power bank to power the Nano and everything worked fine.

Please help me. Thanks.

Without, at least, a block diagram showing how you have all this connected together, no one can help. Words do not substitute for a diagram.
Paul

That is because you were NOT using the Nano voltage regulator. Now you are using it to also power the relay which seems to be too much current for the voltage regulator to handle. Time to redesign, perhaps using a 12 volt relay module.
Paul

Thanks Paul_KD7HB. I tried it on a new nano board and worked fine I added a step down converter to reduce the voltage from 12v to 5v on the nano board. Thanks again.