Arduino resets randomly when using a DC motor
As @Marko wrote, a slow diode can do quite a bit of trouble. Let's look at his model to see if we can find something.

Yes, it is here:

Since it was a load around 100mA, let's try a small switching diode:

It got significantly better, but this diode will still be small here. Let's look at a better one:

So the diode would be fine. If we’re already modeling, let’s do something about the huge latency caused by the too high value Gate resistor:

The 10k resistor was changed to 1k and a miracle happened:

The delay was almost completely gone. So replacing a diode and a resistor has improved the system a lot. Finally, here are all the interesting signs from this tiny system:

If nothing helps, replace the ground wire with a thicker one. :)