Could be a contactor going bad or the noise of the compressor. The contactor is operated by low voltage (24V) and is a magnetic switch that opens and closes a high voltage circuit (240V). If it is that, it is $175- $215 in a Jandy box, or $12.84 from Amazon. Its just a generic 24VAC coil, dual pole 240V A/C contactor. If you don't know what you are doing, don't do it.
View attachment 575083