Buy door jamb lumber, nominally 1-inch thick but actually slightly under that dimension, and 4 1/2-inches wide, to conform to the width of a 2-by-4-inch stud wall with 1/2-inch drywall on each side. Measure the door with a tape measure to get the precise height and width needed for the jamb, which will be slightly wider than the door.
Mark a top jamb board to the width of the door plus 1/4-inch, to fit into dadoes or grooves in the top of each jamb side; jamb lumber comes with these cut. Use a speed square to mark a straight line across the jamb board and cut it with a circular saw. Measure two side jamb boards so the distance from the bottom of the horizontal header to the floor is the length of the door plus 1/2-inch.
Set the three jamb boards in place, on either side of the opening with the header in place to hold the side boards apart. Level the top jamb; set a 2-foot level across the bottom edge and adjust the side jambs with tapered wood shims under the bottom of the boards as necessary to get the top level. Put a shim in from each side.
Use a 4-foot level to plumb one side jamb, adjusting as needed with shims. Tap shims in place with a hammer, one from each side. Cut a "spreader" stick from a piece of lumber to the exact width of the jamb at the header and place it between the bottoms of the side jambs to hold boards in place. Fasten the plumb side jamb with 3-inch galvanized nails and a hammer or galvanized screws and a screw gun. Put fasteners into the jamb and through the shims into the rough frame; you should have three or four sets of shims.
Plumb and fasten the other jamb, using shims from both sides to straighten and hold the jamb board. Use the spreader stick to make sure the opening is the same from bottom to top of the frame. Put nails or screws through the shims in the jamb top to secure it.