Usually a TIP120 Transistor or a Relay Module to allow the low-power microcontroller to control the high-power lock.
: A general-purpose 12V solenoid lock part can be found on the Fritzing Forum , where experienced users often share .fzpz files for common hardware. download solenoid door lock fritzing
Before designing in software, it is crucial to understand the hardware. Usually a TIP120 Transistor or a Relay Module