If you draw an octagon (eight-sided polygon), select one vertex and construct each diagonal from this vertex, you will see there are 5 such diagonals. Thus, for each of the 8 vertices you can draw 5 diagonals and hence there can be 5 × 8 = 40 diagonals.