The 1/2 a is common to both sides.
sin(a - b) = sin(a)cos(b)-sin(b)cos(a) so
sin(pi/2 - pi/n) = sin(pi/2)cos(pi/n) - sin(pi/n)cos(pi/2) = cos(pi/n) (because sin(pi/2) = 1 and cos(pi/2) = 0)
csc(pi/n) = 1/sin(pi/n) so the left hand side of the original equality (ignoring the 1/2 a) reduces to cos(pi/n)/sin(pi/n) which is just cot(pi/n) i.e. the left-hand side reduces to the right-hand side.
.