Hair algae is a tough one. The thing that got my tank over it was a sea hare. Other things could help a little, but the sea hare is what actually fixed the issue. The problem is that they can't go without it so once they eat it all they need to go into a new tank that has some. I had enough in the sump to feed it until the display had a little more again.
A media reactor is a very effective and efficient way to deal with it. It is in the water so you can't physically remove it yourself.
Nitrate and phosphate are simply nutrients in and nutrients out. Figure out where the imbalance is and you will figure out what you need to fix.
Nutrients come in via water if you are not using 0 TDS
water to mix your saltwater and top off and food. Every time you feed you add nutrients to the system.
Nutrients leave with water changes, corals using them during photosynthesis (specifically the endosymbiont zooxanthellae), refugium (macroalgae growth), and special media. Without one of these outputs the nutrients stay in the water column and can feed bad algae.