Since the horizontal lines are parallel, we know from similar figures that the ratios are proportional.
when
24/x=36/12, or
24 36
-- = ---
x 12
We divide the product of diagonals with numbers (24*12) by the number across from x (36) to get the value of x, i.e.
x=(24*12)/36=288/36=8