Push the switch straight down until the two retention clips on its top and bottom faces clear the plate, then lift it out — pulling at an angle or yanking the keycap still attached is what breaks clips and tears hot-swap sockets. Everything else is preparation, tooling, and knowing whether your board will even let you do it.
A mechanical keyboard is one where each key sits on an individual switch with its own spring and its own metal contact leaf, rather than on a rubber dome sheet with a common membrane underneath. That matters here because the switch is a discrete part. On a hot-swap board it plugs into a socket soldered to the PCB and can be removed by hand. On a soldered board it cannot — not without a desoldering iron, flux, and a willingness to accept that you may lift a pad. The single most important step in this whole job happens before you touch anything: find out which one you own.
Turn the board over and look for a small badge, a model number, or a sticker. Failing that, pull one keycap and look at the switch housing. If the plate around the switch has a visible notch or cutout and the switch sits in something that looks like a plastic cradle, you are