Unless you know for a fact that the ice is safe to walk on, stay off it! A general rule of thumb is that you need at the very least four inches of ice to be able to support one person on foot. However, ice experts and winter survivalists will tell you there is NO such thing as safe ice. You are taking a risk anytime you travel on ice.
You must move quickly because your body temperature will drop immediately. Grab for surface ice in the direction from where you came. If need be, use a knife or any sharp object you have to dig into the ice and pull yourself out of the water. Kicking your feet in a swimming motion may help propel you onto the ice. Roll or crawl away from the hole (do not stand up) and move across the ice in the same direction you came from, where the ice presumably is safer.
Once you reach a safe area, you can roll in the snow to blot some of the water off your body. You must be treated for hypothermia as soon as possible. Get into dry clothes immediately. Take shelter if available and stay out of the wind. If you need to and can do it, start a fire to get warm. Drinking warm, non-alcoholic beverages is good, but do not drink alcohol-it will further increase heat loss. Seek professional medical care as soon as possible for follow-up treatment.
If you are snowmobiling when you go through the ice, your snowmobile suit (even a non-buoyant one) and helmet may keep you afloat for several minutes.