Programming relays

I am very new to programming. We are using two speed pneumatic gearboxes. How would I program the spikes so that when I hit one joystick button they stay on and then when I hit the same joystick button again they go off?

See for a well-explained solution.

Thanks a lot. I searched for hrs and for some reason I couldn’t find anything like that.