Measure the top horizontal span of the door opening, from one inner corner to the other, at the edge of the opening.
Mark out the measurement to a piece of trim, using two marks and putting the measured span between them.
Lay the trim on your miter saw, facing up, with the bottom edge of the trim against the back guard rail. Move the trim so one of the marks is under the blade. Swivel the blade to point 45 degrees outward, facing away from the trim. Make the cut.
Slide the trim to put the second mark under the blade. Swivel the blade to again point 45 degrees outward. Make the cut.
Set the piece along the top of the door opening, so the bottom edge of the trim is lined up with the top edge of the opening. The mitered ends should come up and away from the two upper corners.
Load your drill with its pilot bit. Drill pilot holes every 10 inches along the top and bottom edges of the trim. Nail finish nails into the holes with your hammer. Sink the nail heads with your centerpunch.
Measure and cut each of the two side spans for the door, using 45-degree outward angles for the two upward-facing ends, and 90-degree cuts straight across for the downward-facing angles. Install the trim as before, with pilot holes and nails, with the mitered ends butting to the top span to form the upper corners and the straight bottom edges sitting on the floor.