JF-0530B DC12V 300mA 5N/10mm Pull-Push-Type DC Solenoid Electromagnet UK

You can secure it with M3 screws or bolts, and its small form-factor won’t get in the way of other components. The plunger rod has a tapped hole at the tip, enabling you to attach custom links or hooks if needed (or you can let it directly push against a surface).

eBay