Relay control by using microcontroller
You can simply use a transistor array to control the relays. The relay itself isolates the control signal terminal(operating voltage) and switch terminals(NO/NC) electrically.

Or you can avoid a transistor array by using solid state relays(SSR). They have a wide operating voltage, longer life, no mechanical noise and they are optocoupled too. You can directly drive SSR from microcontrollers. When choosing SSRs, make sure to use the correct type for the load you are going to use (both AC and DC solid state relays are available).