I have more than a few heaters that have gotten wet inside for different reasons, including one of those. I dried them out and used them. You have to use some judgement here, of course. A couple of times, I knocked a 2' shoplight into a tank, and it is still in use. As well, it stayed lit while in the water; fresh water is a very good insulator. If you had a heater that could boil your fish if it failed in the on position, it is too big for the tank.
If you suspect water may be getting in, you can use the heater with the control end above the water line. Or, you can toss it and get a new one.
Join a fish club. Don't have one in your area? Start one.