What does a solenoid do?

Can you answer this question?