I have got 6 pet fishes in an algae ridden tank. My plan is to place the tank completely away from sunlight so the algae dies. How would this affect my fish? Edit: Just checked all my fishes died today. Either its the lack of light or just that i forgot to add the chlorine removal or water pump.
There are lots of fish that live in environments without any light (below 1000m in the ocean there is no useful light for vision), however most aquarium fish have not evolved to live in those sorts of conditions. In the future, I think your best bet would be to remove the fish, clean the tank, and then try to manage your nutrient inputs so that the algae doesn't grow out of control.
As noted fish live in the dark , to the extent that they no longer have eyes.As noted the algae will just go dormant until there is light. I use plants to compete with the algae for nutrients , works well. Algaecide is not a long term solution. I expect you could find some lights which have very little output in the frequencies/ spectrum needed by chlorophyll ( and block any sunlight) but you still have light to see the fish.
Fish can live in the dark completely however they will potentially have no source of food at most Algae cannot reproduce without sunlight.
Some new research has been conducted where algae can gain energy from other means apart from the sunlight including dim light from hydrothermal vents deep in the ocean. https://indianapublicmedia.org/amomentofscience/photosynthesis-without-sunlight/