Turn off the power, work out what's behind the wall, then refit the switch with the right fixing and test it.
Part P of the Building Regulations covers electrical safety in England. A like-for-like switch refix isn't notifiable, but special rules on positioning near water apply in bathrooms.
Before you start: Which electrical jobs can I do myself? Part P explained
Travis Perkins, Tooled Up and Machine Mart links are affiliate links: if you buy after clicking, we may earn a small commission at no extra cost to you. B&Q and Amazon links are plain searches and earn us nothing.
Save this as a project