Or you could add up all the sides lengths for an easier way. This works for any shape.
Different shapes have different formulas to find the perimeter. You need to mention the figure to get to know the formula. The perimeter of square is 4x side and for rectangle it is 2 x (length + width).