The energy the coil takes to close the contacts of a relay is part of the specifications for that relay. This current must be within the range of the logic circuit driving the relay. Many small relays are available that can be driven directly from logic currents of ~20 mA. If the relay being used has a higher current rating than the logic can provide, a transistor can be used to amplify the current from the logic circuit to drive the relay.
One other consideration when using relays is the current spike created by the coil. When a coil of wire has current running through it, a magnetic field is created. This closes the contacts of the relay. When the current is removed from the coil, the magnetic field collapses and this causes current to flow through the wire until the magnetic field is completely collapsed or gone. This can cause a damaging voltage spike back towards the logic circuit. This is called flyback and is avoided in the above circuit with a flyback diode.