Your question is rather vague, but lets start off simply:
The solenoids are coils of wire with an iron core.
When a current passes through the solenoid, the iron core moves causing the valve to open/close/direct the fluid flow to a different port.
Without detail of the valve you have in mind, it is impossible to say why there are two solenoids or what function they perform.
To operate the valve using a PLC, use two digital outputs. One to operate one of the solenoids, the second to operate the other solenoid.
Write the control program to implement your function.
JimB