External Power Problem

Hi I want to make a car with arduino leonardo.
I bought a relay module.

I write an example code. My car must go forward and back.
I am trying with leds with usb. My code is running good.
but I try with 6v external source. Code isnt running good. Its working randomly.
I am using Vin and Gnd for external source. Iam tryinig using reset.

My car must go forward and back.

How are your motors powered?