Cutting a triangular pyramid at precise z coordinates
You can easily achieve this with a boolean modifier, using a plane.
Add a plane, set its height to be where you want to cut the pyramid,
then add a boolean modifier to your pyramid, set the plane as the object, and duplicate the pyramid.

One copy of the pyramid should have the boolean operation parameter set to difference (keep the top of the pyramid), while the other should be set to intersection (keep the bottom of the pyramid).

Apply the modifier on both copies to complete the process.