3 or 4 days of total darkness (cover the tank so no light can get in) can kill the algae and give you a fresh start, you need to be careful that the dying algae doesn't pollute the tank so daily 10% or 20% water changes and running carbon would be best. Vacuum the sand bed first. No feedings during blackout.
the hair algae is difficult to get rid of but easier to keep away, the diatoms will will eventually eat themselves out of house and home, they mainly feed on silicates. The fish and corals will be fine just bring the lights back on slow, reduced photo period and intensity and ramp back up slowly over a few weeks.
The diatoms will not kill themselves in that way because as diatoms die they release silicates furthermore helping the populations.