Cubic yards is the unit most bulk materials are sold in: concrete, gravel, mulch, soil and sand. The calculation is the same for all of them.
The formula
Multiply length by width by depth to get volume, keeping every measurement in the same unit. Working in feet and inches, convert the depth to feet by dividing inches by 12, then divide the total cubic feet by 27, since a cubic yard is 27 cubic feet.
A worked example
For an area 10 feet by 12 feet at 4 inches deep: 10 times 12 is 120 square feet, times 4 divided by 12 (one third of a foot) is 40 cubic feet, divided by 27 is about 1.48 cubic yards.
In metric
Multiply length by width by depth all in metres. An area 3 by 4 metres at 10 cm deep is 3 times 4 times 0.1, which is 1.2 cubic metres.