2 Pin JST-SM Connector. Commonly used on printers for connecting end stop wiring to controller boards. Not for high current use.
Typically found on Creality Ender 5 / 5 Pro / 5 Plus series 3D printers.
To use, strip the insulation from wire and crimp the pins to each wire lead. Orientate the pin with the latch facing towards the opening on the face of the connector. Insert the pin into the housing until it latches in place.