Some models have the switch built into the motor and would have to be replaced. If it is external you can remove the switch from the terminals and replace.
First gain access to the motor by taking off the panels and isolating the motor itself. Next, remove all wiring to the motor itself and disconnect any mounting screws. It may take some effort but you will have to remove the motor and purchase a new one. The centrifugal switch is an integral part of the motor in dryers.