The key to remembering how to find the volume is finding the area of the base multiplied by the figure's height.
Triangular prisms are very similar to rectangular prisms. The main difference is the shape of the face has changed from a rectangle to a triangle. The picture above that shows the rectangular prism has been divided into layers with the same size (area) is relevant to finding the volume of a triangular prism. To get the same size layers with each cross-section, you will want to find the area of the triangular face, and then multiply that by the length or height of the prism depending on which way it is oriented. (If the prism is laying down, it will be the length. If it is standing up, it will be the height.)
The pyramid is 1/3 of a rectangular prism. Since we do the area of the base times height for a rectangular prism to find the volume, the only added step is multiplying by 1/3 to get the volume of a pyramid. Keep in mind that the slant height is used for surface area because it is on the outside of the 3D figure. The height on the inside of the pyramid is used to find the volume.