A relay is really simple. Unfortunately, it typically uses more current than is safe to deliver through a digital output pin of a microcontroller. Thus, you typically end up with a small transistor driven by the microcontroller, and the transistor drives the coil of the relay. Look at the coil voltage and current ratings of the relay to make sure you have the right kind of power supply for the coil available.
A relay is a few dollars, and a transistor is fifty cents, and you need a base resistor if you use a NPN like the 2N2222 (no resistor needed if using a N-channel CMOS like the 2N7000.)
An alternative is to use a power P-channel MOSFET as a high end switch, with a 4.7k pull-up resistor from gate to source, and source connected to + of motor battery. Then use that same transistor from above to pull the gate low to turn on the MOSFET. Note that MOSFETs often do not like more than 20V between source and gate, so if your motor is high-voltage (more than 12V, say,) it's probably a good idea to include a 12V Zener between source and drain, and another resistor between drain and switching-transistor (say, 2k2 or so.)
If you just want to buy something that works, try a suitably rated gear motor driver board (H-bridge.) You only need one half of the H-bridge. Pololu makes a variety of motor drivers that can take high voltage and/or current.
Here's how I would build it:
Bonus points for putting a 2 mA LED between R2 and Q2 to use as an "on" indicator and do something useful with the small current that will flow while this is on :-)
If the voltage you're switching is 12V or less, then you can remove D1 and R2 (replace R2 with a wire.) if you're switching more than about 24V, you want to use the SUP75-P05 rated for 50V, and probably want to make R1 less and R2 more (swap their values, say.)
Finally, this circuit does not let you use PWM to control the switched load, because it doesn't switch very fast, and would overheat if you switched it hundreds of times per second. MOSFETs can carry a lot of current when totally ON; they are vulnerable in the moment of switching when resistance is higher, but they're not blocking all the current yet.