Well pump only works with on/off switch not control box
The clicking is the relay being pulled in. This is a common failure in relays after thousands of cycles the contacts burn and do not make good contacts, I have special burnishing tools to clean the contacts and this can also be done with a fine sandpaper (400+ grit), but cutting away contact material is a short term fix in some cases. A new relay is going to be needed in most cases.
The part number is usually stamped on the body, or the voltage of the controller and the voltage &amp; amperage of the relay will be needed to get a replacement.

I only see 4 wires, 2 are the control voltage that pull in the coil and the other 2 are the “switch” that sends power to the pump.  Make sure to label them, so you don’t mix them up.