I've been doing this in class too lol. First, you wanna label the length and width. For example, on the top of the square you label (X-2) meters and you do that same thing for the bottom (this is for the length by the way). Now, what you want to do is label (X+2) meters on the sides of the square.
Now that's all done, you do you solve 4x+8 and you will get your answer which is X=2.
I'm just not sure how I would solve your problem. Sorry