You need to subtract (2y+24), that is you need to compute -(2y+24) = -1(2y+24) = -2y - 24.
If you think that y^2 - (2y+24) = y^2 - 2y + 24, then please think about this. 2y+24 = 24 +2y. So y^2 - (2y+24)= y^2 - (24+2y) = y^2 - 24 - 2y. So which is it, y^2 - (2y+24)= y^2 -2y+24 OR y^2 - (24+2y) = y^2 - 24 - 2y?? Can it be both?
In the end you have to subtract 2y and subtract +24 or 24.
For the record (y^2 - 2y - 24)(y-6) is not the final answer