Carefully measure your door(s), and mark the width and height on the sole (bottom) plate and adjacent studs, respectively, of the exterior wall frame.
Beyond the door width, add marks at 1/2, 2 and 3-1/2 inches to each side for shims and insulation, trimmer studs and king studs, respectively. If studs already in place in the wall frame happen to be in the right place, you can use them, of course.
Prepare your king studs by cutting two 2-by-4 studs to fit between the wall frame’s sole and top plates. Set these studs into place, using the outside marks (3-1/2 inches beyond the door width) you made in step 2. Check them with a level, and then toenail them (nail them diagonally) to the top and sole plates.
Mark the door height on the king studs and add another mark 1 inch higher. Cut two 2-by-4 trimmer studs to this greater height and nail them to the king studs.
Prepare your door header according to local building code. In general, a wall that isn’t load bearing only requires a horizontal 2-by-4 resting on the trimmer studs. Load-bearing walls or wider doors may require a pair of 2-by-6 (or larger) boards screwed or glued to a panel of plywood between them. Check local building codes for your specific requirements. Once the header is built, nail it to the trimmer and king studs.
Cut one or more 2-by-4 cripple studs to the distance between your installed header and the wall top plate. Space them evenly between the king studs (e.g., a single trimmer stud would be at the midpoint of the header) and nail them to the top plate and header.
Perform a final check using a level and square to make sure your door frame’s sides and top are level and the corners are square. If you need to adjust anything, try tapping the studs with a hammer or using a pry bar.