Reproduce 2CH Relay Optoisolated on custom PCB
The transistor must be able to handle the current that is used to switch the relais.

I do not know what relais you are using, but the 2N2222 is usually OK for such a small one.
These are flyback diodes, so they are not Zener. Choose one that can handle the current and voltage in your circuit; a 1N4148 is probably OK.
The optocouplers are PC817C, i.e., they have a guaranteed current transfer ratio of somewhere between 200 % and 400 % when the forward current is 5 mA.

The CNY75B has a guaranteed current transfer ratio of somewhere between 100 % and 200 % when the forward current is 10 mA.

You can use any optocoupler as long as you get all the currents correct for your circuit.
First, determine how much base current the transistor needs to saturate (this is typically one tenth of the collector current). Size the base resistor appropriately. Then divide that current by the minimum guaranteed CTR to get the required LED forward current. Add a safety factor. If that is not exactly the 10 mA from the CTR test condition, the actual CTR might be lower, so add another safety factor. Size the resistor in front of the LED appropriately to get that current.