Programming Arduino Uno to turn on/off the current of Electronic Latch Lock

I am new in using Electronic Latch Lock. I have Electronic Latch Lock Catch Door 12V Electro-magnet Release Solenoid Slant Slug . Here the link with description. Electronic Latch Lock Catch Door 12v Electro-magnet Release Solenoid Slant Slug for sale online | eBay

I would like to use the electronic Lock when a micro switch is pressed to lock/unlock the Electronic Latch Lock . In the description of the Latch Lock says that : Turning the current on will lock and turning it off will unlock the mechanism. So how to program Arduino Uno to do that and how to connect this Electronic Latch Lock to Arduino?

Thanks

You can't connect a 12 V solenoid directly to the Arduino. You could use a transistor or a relay, connected to the Arduino that it triggers to turn the 12V on or off.

Turning the current on will lock and turning it off will unlock the mechanism.

Look at the StateChangeDetection example in the IDE to see how to detect that an input has changed state. Once you have detected that the input has changed state you can change the state of an output that controls the electronic lock via suitable hardware.