Your heat pump is built to handle frost on its own. A sensor on the coil or a board running on a timer watches for ice and calls for a defrost cycle when it's needed. When that happens, a reversing valve flips the system into cooling mode for a few minutes, which sends hot refrigerant out to the coil outside instead of into your house. The outdoor fan shuts off at the same time, so the heat stays put on the coil long enough to melt the ice instead of getting blown off into the air. That's the whole cycle, and on a normal day it runs, clears the frost, and switches back to heating without you ever noticing.
Ice that won't go away usually means one of these steps isn't happening. A reversing valve that's stuck won't let the system switch over, so the defrost cycle never starts. A bad sensor can miss the frost entirely. If the outdoor fan keeps spinning when it should be off, the coil never holds enough heat to melt anything. And if the system is low on refrigerant, the coil runs colder than it's supposed to, building frost faster than a normal defrost cycle can keep up with.