Cut two 2-by-4 boards that are the same height as the doorway. These are called the jack studs.
Nail the jack studs to the studs in the wall frame -- the king studs -- where you are installing the door.
Measure the distance between the king studs, and cut two 2-by-4 boards to fit that distance. These boards will be the door header.
Lay the two header boards flat on top of the jack studs and nail them to the jack studs.
Measure the distance between the top board of the header and the top plate. The top plate is the top board in the wall frame.
Cut a 2-by-4 board to fit the distance between the header and the top plate. This board is called the cripple stud.
You can place the cripple studs to greater than 16 inches from either of the king studs, so cut more than one cripple stud if necessary.
Place the cripple studs between the header and the top plate and nail them into position by driving the nails through at a 45-degree angle.