The number of diagonals in a certain regular polygon is equal to $2$ times the number of sides. How many sides does this polygon have?