Fundamentally, you'll want to solve for the volume of the depicted pyramid, then subtract from that the volume of only the dotted-line pyramid in the illustration. The challenge is in finding the value for H.
My personal approach here observes that we're dealing with two similar (in the geometric sense) pyramids that differ only by scale, and that the proportion of X to H is the same as the proportion of (8m - 2m) to 8m.
Incidentally, the name for the type of shape shown by the solid lines is frustum, which is like the 3D analog to a trapezoid.