you get the switch thats fitted to a motorbike, or a microswitch and figure out how to install it.
the rear brake on a moto works on the foot lever, and the switch for the front is in the hand lever. normally open, it CLOSES when you pull the lever, allowing current to flow.