For any $n$ side polygon, the number of diagonals are $\frac{n(n-3)}{2}$.
We can prove this as follows:
First, select a vertex from the polygon. This can be done in $n \choose 1$ ways.
To draw diagonals, we can choose any other vertex except the neighbouring vertices, giving us $n -1\choose 1$ ways.
This gives us a total of $n \times (n-3)$ diagonals.
However, we have overcounted by a factor of two here, since diagonal from $AB$ is same as diagonal from $BA$.
Hence, the total number of diagonals are $\frac{n(n-3)}{2}$