We will only deal here with devices that need to be switched ON and OFF - not devices that need the power reversed. That normally requires an H-bridge which is a much more complicated circuit. That's about what you need to drive an LED but not a motor. The easyist way is to simply add a gate between the micro and the power device driver. Any logic gate that is compatible with your micro can be used.
Gates are cheap, micros are expensive.
If you're still interested, look up data on the 4N25. For loads Many loads are small but just too big for a micro to drive. This includes small lights and small motors. Make sure to measure the current draw of your device before deciding on a drive scheme. Make sure to stall motors to see what their maximum current draw is.