The relay switch that sends electricity to your air conditioner's compressor is known as a contactor. Contactors pull electrical contacts apart when power is not needed, and close the contacts to power something up. If the contactor in your AC unit fails, the compressor can't send out the refrigerant needed. A failed contactor will either keep your unit running continuously, or keep it from running at all, depending on whether the contacts were open or closed when the circuit failed.
Continuously Running AC
Open your air conditioning unit and locate the contactor (see Resources for websites to consult if you don't know where the contactor is or what it looks like). Check to be sure that the contact points are clean. Grime, insects and dirt are responsible for a large percentage of contactor failure, and many people have paid $100 or more to have an electrician simply wipe spiderwebs away.
If the contacts are clean, but appear burned or even welded together, you will need a new contactor. Be sure to turn the power off at your circuit breaker before removing or installing the contactor.
AC Not Running
Look on the other side of the contact points and you will see thin strips of metal connected to the contacts and the wiring that leads to the air conditioner's motor. These strips are the overload heaters that function in the same way as fuses. If there is too much electricity going through them, they melt and whatever they were supplying power to stops. If a visual inspection shows that one is melted, you will need to purchase a new one and install it. If the new one burns out soon after installation, then you are most likely getting too much voltage from the contactor. Whether the overload heaters are fine or if they burn out continuously, you will need to use a voltage reader on the contactor to see if correct voltage is being delivered from your contactor. Consult your owner's manual for the needed voltage, which is likely 24 volts. If you are getting too much or not enough voltage, replace the contactor.
When replacing a contactor, try to get the same make and model as the original. If that isn't possible, be sure to get one with terminals that are the same as the one you took out. Make sure the voltage rating is the same as well as the load capacity (amperage). You can find all that out through the literature that comes with the new contactor, or by speaking with the salesperson wherever you make your purchase.