How to connect this kind of 3-pin switch please

Connect pin 1 and pin 2, or pin 2 and pin 3, at least one needs to be connected to pin 2 on it.

Toggle switches are used to switch circuits by toggling the switch handle to make or break the circuit. Toggle switch commonly used varieties of single-pole double-position, single-pole three-position, double-pole double-position, as well as double-pole three-position, etc., which is generally used for low-voltage circuits, with a flexible slider action, stable and reliable performance characteristics, toggle switches are widely used in: a variety of instrumentation / instrumentation equipment, a variety of motorized toys, fax machines, audio equipment, medical equipment, cosmetic equipment, and other electronic products in the field.