Question about relay module
That's the way it works. The schematic doesn't say which value the series resistor is, but on the website it says it says the current is between 15 and 20 mA, that's what most microcontrollers just can sink, if you would like to use that. If you want to use a switch then there's no problem.  



The schematic also shows a second power supply (JD-VCC) for driving the relays. It doesn't say so expressly, but since it's called a 5 V module, I presume that also needs 5 V. You can use the same supply for both then.

This is really a silly circuit, though. The optocoupler is not necessary at all since the relay already provides isolation (though only 1500 V).