Inspect the cooling fan switch's wires and connections. Cooling fan switch problems are often caused by faulty wiring or loose or corroded connections rather than the failure of the switch itself. If the wires or connections are bad, replace them. If you think the switch is defective, it should be tested.
Also listen for a pinging noise, failed cooling fan switches can cause pinging when the engine is overheating.