It is pretty easy, remove the 8 screws in the back, the 2 on the front, and push the tabs on the switch, remove the wires and pull it out, then do the reverse with the new switch.
@intelitechstudios I have a Dirt Devil endura compact and it’s awful the brushroll is tiny and the non pedal release is horrible everytime i wanna push it to another room in the upright position it always slams down on my floor into the reclined position I hate it so much!