On circuit breakers, light switches, and kitchen appliances, opening or closing an electrical contact is a mechanical action bringing together pieces using an applied force to bring together two conducting pieces of material. In electronics these days, opening or closing an electrical contact is often accomplished with transistors or relays.
For transistors, the bipolar junction transistor (BJT) or metal oxide field transistor (MOSFET) are popular options. In years past, uni-junction transistors were used for switching applications but have now become less popular. Transistors pop up mostly in small electronics while relays are most often used for larger electrical loads with current draws beyond a few mA.
When designing a device that incorporates electrical switches, it is important to understand the application in order to pick the best device to engage your circuit. In the teeny tiny operations of a microchip, billions of microscopic BJT transistors are etched on a silicon wafer. Whereas, a much larger BJT (on the scale of inches across) might be used to engage the power sent to an induction cooker. Both these applications rely on the BJT concept although the BJT designed for the purpose is wildly different. Similar stories can be told for MOSFETs and relays that are sized for the application.