Lets use a multi-meter to test the compressor. First unplug the refrigerator and remove the start relay off of the side of the compressor. Go to the single pin on the compressor and check to one of the pins that are side by side on the compressor. The run winding will read 1-5 ohms resistance. Then stay on the single pin and go to the other pin. The start winding will read 3-11 ohms resistance. If your readings are out of these ranges, then you have a bad compressor. If they are within these ranges, then you have a bad relay overload. Here is a link to the parts diagram. Hope this helps.
Unit parts replacement parts for WHIRLPOOL ER8MHMXML02 REFRIGERATOR | AppliancePartsPros.com