If your fish are at the surface gasping for air you need to apply the following emergency first aid immediately, then figure out what caused this condition and fix it long term.
The fish need highly oxygenated water quickly.
Do this by turning on a hose or any other water pump and spraying the water up in the air so it gets oxygenated then lands in the pond. If you have a waterfall or fountain, turn it on and leave it on until the crisis is past. Add Stresscoat if its on hand.
If the pond is a large earthen pond, use the biggest pump you can get your hands on and spray water over the pond. If you do not have a second water source, its ok to pump the water from the pond.
If it’s possible to also do a water change, do as deep a water change as you can. If you are using chlorinated public water supply and do not have any dechlor handy, don’t change more than 10%.
If you are using groundwater or have dechlorinator handy, drain the pond down til the fish’s fins are starting to stick out of the water. If your source of water is more than say 10 degrees different in temperature, so the water change over a several hour period.
If you have koi and this is happening in the early spring, try to avoid netting and removing them from the pond unless you have another pond of better / safer water quality all ready for them to go into. This time of year koi are just coming out of winter hibernation and their immune system is very fragile. Netting and moving them would just add to their stress.
Review site conditions and get some test kits to find out what caused the sudden loss of oxygen.
If its hot weather and there is excessive algae, plus the weather has been cloudy, dead organics are probably the culprit and added oxygen will be needed until this is digested. For earthen ponds, consider getting a bottom aeration system.
The above type of oxygen problem usually does not develop in lined ponds with a 24/7 pumping/filtration system running.
In lined ponds the problem more likely is an unexpected sudden overload of nutrients from storm water runoff, grossly overfeeding by’ helpful’ visitors, or a fish disease/ parasite infestation. Water changes will help the first two issues. Close examination of the ailing and or dead fish, (post mortem) is needed for the later problem. Get professional help if you suspect a fish disease or parasite. Look up your local koi club or consult one of the on line fish health sites such as KoiVet.com.
If you used too much Algaway 5.4 or AlgaeFix for the size of the pond and /or you did not keep your waterfall/filtration system going, this can lead to oxygen depletion.
If you had a massive algae bloom and treated it all at one time with any algaecide, the dieing algae can consume all the oxygen.
So, there can be many reasons why you had the problem and once you get past the crisis you can take the time to find out why it happened and how to prevent it from reoccurring.
But your first priority is to get some oxygenated water going to buy you some time until you can solve the underlying problem and the hose sprayed in the air over the pond will do just that.