Translate this English statement into an equation.
If the side of the square is x - 1, then the perimeter is 4(x - 1).
But the problem also says the perimeter is 7x - 22.
Things equal to the same thing are equal to each other; in this problem you have 2 expressions for perimeter which are therefore equal.
4(x - 1) = 7x - 22
4x - 4 = 7x - 22
3x = 18
x = 6