Find how many unit cubes fit in one layer: length x width. Multiply by the number of layers. Volume uses cubic units, not the square units used for area.
Worked example
A prism with a base 4 cm by 2 cm has eight cubic-centimeter cubes in each 1-cm-high layer. Three layers give 4 x 2 x 3 = 24 cubic cm.
These are three layers shown separately, not three different solids. Stack them to build a prism with volume twenty-four cubic centimeters.