4 optic relay via snow blower motor with hex output & arduino uno

I am trying to use this snow blower motor as an actuator to rotate my launching system from left to right using buttons. I have a 4-optic relay but will only be using 2. The relay is because the motor operates at 5v. However, the voltage supply is 12v so that is where the relay comes into play. I am using and atmega328 on an arduino. I am looking for a wiring diagram and code that would enable my motor to perform what I have just specified. I found a code listed on this website but it is for a linear actuator motor so I am not sure if that would make my snow blower motor function the same way. I will attach a picture of the code and wiring diagram to see if that setup will coincide with the motor i have as well. I really need help with this as it is for a senior design project. This forum is my final chance towards completing this project. I will appreciate any help mainly the code since I am electrical.