A container is in the form of a frustum of aright pyramid 4m square at the bottom 2.5m square at the top and 3m deep.Calculate the capacity of the container

Visualize a square based pyramid with its top cut off.

let the height of the cut-off part be h m
then by similarity:
(3+h)/h = 4/2.5
4h = 7.5 + 2.5h
1.5h = 7.5
h = 5

So the whole pyramid has volume (1/3)(4^2)(8) m^3
= 128/3 m^3
volume of the imaginary pyramid that was cut off
= (1/3)(2.5)^2 ( 5) = 125/12 m^3

volume of the frustum = 128/3 - 125/12 m^3 = 129/4 m^3 or 32.25 m^3

A bit of searching will let you find a formula for the volume of such a solid,
perhaps your textbook would even give you one.