The defrost cycle in your air conditioner is a reverse of normal function. The air conditioner reverses refrigerant flow and starts warming what it was cooling, and cooling what it was warming. Heat pumps do this in order to melt frost on their evaporator coils. Refrigerator AC units do this to melt the frost that builds up in freezers. If the cycle is left undone, it can lead to lower efficiency and ice issues. If the cycle continues without stopping, it accomplishes the opposite of what you intended.
Settings and Size
A potential cause of a constant defrost cycle is the setting and size of the unit. If you have a heat pump manually set to cool instead of warm, for example, it might appear that the heat pump is in defrost. Check your settings carefully, and check the size of the unit as well. If your AC is designed to cool and heat a larger space than your house, it might keep entering a defrost cycle as a result of inefficiency.
Some AC units might have a timer that they use to keep track of normal heating and cooling as well as the defrost cycle. When the timer moves to defrost, the unit switches over until the timer cycles back again. If a timer becomes stuck on defrost, it will only send defrost signals. Replacing the timer should fix the issue.
Your air conditioner might also use sensors to tell what temperature the air is inside the system and when it needs to enter a defrost cycle. If these sensors fail or become detached, the thermostat will receive the wrong data and will keep starting a defrost cycle when it does not need to. Check the wiring and thermistor devices that your thermostat uses for any signs of looseness or damage.