It is important to check and see whether the indoor fan (evaporator-air handler) and the compressor are running simultaneously and then you should shut the unit off so that all of the ice can melt.
If your evaporator fan isn’t running but the compressor is, you have already identified the reason why your AC unit is freezing.
The indoor coil will start to freeze if the compressor is running but the evaporator fan is not functioning.
Find out whether there is a sufficient amount of ice for stopping the fan.
If this is the cause (which it often is with wall-mounted ductless mini split designs and certain window AC units) the fan could start running normally again after the ice has melted and the cause of your AC freezing issue will likely be something else.
If you own this air conditioner equipment and are trying to resolve the freezing problem on your own, it may be more efficient all around to simply call in a service technician, especially if you have determined that the evaporator fan isn’t operating with the compressor and if the ice build-up is sufficient for stopping the fan.
After this ice has melted, check the blower blade and fan in order to see if something else is obstructing these, such as mold growth, a plastic bag or any other form of debris.
Take out all obstructions and if required, take out your blower and clean it.
Before you start taking the remainder of the unit apart, check to see if the thermostat is functioning properly.
Are the cool contacts opening when the thermostat is set higher than the temperature of the room?
If not, then the thermostat has malfunctioned and is not turning the unit off, which can definitely be the cause of your freezing issues.
If your fan contacts are closing but the fan isn’t operating, check in the air handler to examine the fan relay.
When the fan relay is not receiving control voltage, the circuit between the fan relay and the thermostat is open.
Check for connections that are loose, disconnection, bad connections or broken or damaged wire.
If it is not energizing in spite of the fact that it is getting voltage control, this component has failed and will have to be replaced.