You do need to understand what I/O pins on the Arduino are. They are basically logic values corresponding to 5 V for a "HIGH" and 0 V for a "LOW". They are primarily intended to control logic circuits. They actually do have the ability to provide about 20 mA comfortably, sufficient to light a common LED with a current limiting resistor.
If you want to control something else that requires any significant current, such as your motor, then you need a switching circuit and nowadays, a MOSFET is the most appropriate sort of component. These are readily available in modules to interface to an Arduino output pin.
Much the same applies to the "5V" pin on the Arduino. It is there to provide a 5 V reference for sensors and control circuits. It is not a "power supply" of any sort.
You should not be using "Vin" or the "barrel jack" of a UNO or Mega 2560 to power the Arduino in a "real world" system; you can power it by 5 V to the USB connector or (preferably) the "5V" pin and of course, ground. You must just be careful to disconnect the "5V" pin from your 5 V power supply whenever you plug the UNO or Mega 2560 into the USB port of a PC.