Underhood Junction Box. Just swap the relay with one that is identical.
I suspect it is low on refrigerant. You can jumper out the low pressure switch to rule that out (either short BK/YE to ground, or jumper BK/YE to RD/YE at the pressure switch connector, on the filter dryer). If it works reliably when jumpered, you need servicing. Personally, I'd have a paper clip handy, wait for it to fail, pull that connector off and jumper it. If it comes on, it either needs serviced or needs a new pressure switch (it's called a cycling switch) and it is replaceable without de-servicing. It's also pretty cheap and readily available (NAPA).
Could also be a worn compressor clutch. As the gap increases, it won't reliably engage. They can be shimmed.
2000 2.5 MO5D 4.10 one-wheel drive DD - gave to my older son
1990 STX 87 2.9 going in.....Junked it
2000 3.0 4WD M05D 4.10 S-cab Off-Road package with 235-75-15" tires, hotrod DD, lol