Explanation:
we can either count the squares (by sine lines are just going somewhere through the squares cutting them into unknown sizes).
or we can think and see, that we have 2 shapes combined into 1 larger shape :
1. the bottom rectangle 6×2 units
2. the top triangle 6 units baseline, 2 units height.
the area of a rectangle is length × width.
so, in our case :
6×2 = 12 square units
the area of a triangle is
baseline×height/2
so, in our case
6×2/2 = 6 square units
so, in total our figure has
12 + 6 = 18 square units