Air conditioner freeze up is cause by a couple of problems.
You may be running low on refrigerant. Low refrigerant levels can make the cold coil too cold. Call for help from your local AC service folks. Fix the refrigerant leak and fill it up.
You may not have enough airflow to keep the cold coil warm enough. Think of the warm air from your house as heating up the cold coil to keep it above freezing. If there is not enough airflow the coil gets too cold and starts to freeze the condensed water before it can drain away. Check for a dirty filter. Make sure that you registers are all open and clear so air can flow freely. Shutting cold air outlets in some rooms can end up costing you money when the AC freezes up.
Make sure the fan is actually moving air when the AC is running. Check that the fan is running fast enough. When I had a new furnace installed, the service tech set the fan wiring to run a medium speed. Changing to high-speed stopped AC freeze ups.
If your AC runs all night on cool nights it may freeze as well as waste money. You may have a bad thermostat.
If you let the AC continue to run after the coil freezes up you are wasting money and risking damage to the compressor. It is the most expensive part of the air conditioner.
If your air conditioner is making ice, you may have a drainage problem. When the coil thaws out the water has to go somewhere.
When the hot sweaty air hits the cold coil of the air conditioner, it not only cools the air it squeezes out the moisture.
In humid weather, the air conditioner will condense a lot of the water vapor into liquid that should be drained outside. If the water builds up in the drip pan under the cold coil of your AC it will start to freeze. The ice will block the drain hole.
An overflowing drip pan is the result of a frozen evaporator coil, not the cause of the icing.
When the drain hole is plugged on a window unit, two ugly things can happen.
A freeze up that stops the AC from cooling your home.
If the unit is level or tilted the wrong way, water will leak into the living space of your home. You will have a wet mess inside the house when all the ice melts and the water runs in.
When freezing starts, ice grows up the cold coil. As time goes on the ice grows up the coil, defying gravity, until the air passages through the coil are blocked. That stops the flow of cold air into your house. The air conditioner still runs, using up expensive electricity, but the temperature in the house goes up.
The AC can not cool the house because the flow of cold air is blocked by the ice. Even if you can not see it, you can tell it is iced up when the unit runs but there is little or no air moving.
When you have a freeze up it is time for action:
Shut the AC off.
On a window unit gently wedge the AC housing up inside so it will drain outward. If it drains inside you will have a mess when all that ice melts.
While you are waiting for the ice to melt, locate the drain and make sure it is clear.
Go outside and clear the drain hole on the outdoor end of your window unit.
Think about opening up the ductwork on your central Air Conditioner so you can suck the excess water out using your shop vacuum. Vacuum out the drain line to make sure it is clear. Switch the hose around on the vacuum and blow through the drainpipe to make sure it is clear.
You can either let the ice melt on its own or help it along with a hair dryer. On the other hand, you can run the fan to help thaw it out once part of the frozen coil is open to let some of the airflow to pass through. This will speed up the melting of the ice. The price is more electricity wasted and moisture is blown into the house.
After the ice is gone and the pan drained, switch on the air conditioner. It should start cooling right away.
Ice prevention means keeping the drain open.
If you have a window type AC, it should be tilted ever so slightly. It should be high indoors and low outdoors. There is a drip pan built in the floor of the AC cabinet to catch the condensed water.
The water should run toward the outdoors end of the AC unit. There is a drain hole, some where at the outboard end to let it drip to the ground. Some units have a fitting for a pipe or hose to direct the water where you want it. The ground under the AC is a good place to plant flowers or vegetables to benefit from the watering.
Make sure that the drain hole is clear so the water can get out.
Central air conditioning has a cold coil hidden in side the ductwork by the furnace. It has a drip pan under it to catch the water and a drainpipe that should run to a floor drain.
It is a good thing when you see water running out of the drainpipe. If it is not coming out the drain then it is going somewhere it should not be. If it drains down inside the furnace, it will cause rusting of the furnace. In addition, the moisture will be blown back into the house by the fan until it freezes and blocks the air again. Check and clear the drainpipe every week in hot humid weather.