im new to betta's so hear me out, my male is flaring his gills out and attacking the side of the tank, i guess its b/c he can see his reflection, 1) can this hurt him and 2) should i get something to put on the sides of tank to maybe to try and stop this.. he seems to only do it when its dark and his tank light is on.

yes it is normal and no he can not hurt himself unless he rammed the glass really hard. The constant flaring however may stress him out. A lighter background oppose to a darker one can reduce the sight of his reflection. hopes this helps! Maybe someone else can chime in and offer other advice.

Right tsoto flaring is good but not all the time. Try to discourage this behavior by putting a peice of paper on the outside of the tank is the spot where he is attacking. Hopefully it is only the one spot where he sees himself