The volume of the empty trench is the area of the end times the length If you convert all the units to feet the area of the end of the trench is
\[\frac{8}{12} \times \frac{18}{12} \mbox{ square feet}\]
and hence the volume of the empty trench is
\[\frac{8}{12} \times \frac{18}{12} \times 25 = 25 \mbox{ cubic feet.}\]
To calculate the volume of gravel you need to subtract the volume of the pipe. The volume of the pipe is also area of the end times the length. The end is a circle of radius 2 inches or $\large \frac{2}{12}$ feet and hence the volume of the pipe is
\[\pi \; \left(\frac{2}{12}\right)^2 \times 25 = 2.18 \mbox{ cubic feet.}\]
Thus the volume of gravel you need is $25 - 2.18 = 22.82$ cubic feet.
To convert this to cubic yards you can use the internet. You can type What is 22.82 cubic feet in cubic yards? into the Google search window, I'm a Mac user so I would say
Hey Siri what is 22.82 cubic feet in cubic yards?
The calculations for the second drain are analogous.