Choose the location for the wall by using a stud finder to locate the studs in the intersecting walls that the new wall will be attached to. Attaching the end studs of the new wall to the studs of the existing walls can strengthen it.
Lay 2-by-4 boards on the floor where the wall is being built. Cut into the carpet and padding with a utility knife, using the 2-by-4s as a guide. Lift the boards out of the way, and remove the carpet and padding to expose the subfloor.
Cut the molding away from the base of the intersecting walls with a reciprocating saw.
Mark the location of the doorway onto the subfloor, and measure the distances from the ends of the doorway to the walls. Cut pressure-treated 2-by-4s that match these distances to be the sill plates upon which the wall framing will sit.
Attach the sill plates to the floor with galvanized screws every 6 inches.
Cut a non-pressure-treated 2-by-4 that is the same length as each sill plate. These will be the bottom plates for the frame. Cut a third board that measures the length of the entire wall, which will be the top plate.
Cut the wall studs out of non-pressure-treated 2-by-4 boards. Calculate the height of the wall studs by subtracting the thickness of two 2-by-4s from the distance between the ceiling and the top of the sill plates.
Nail a stud into each end of the bottom plates, then nail studs in between the two end studs, keeping the studs spaced no further than 16 inches apart.
Nail the top plate to the tops of the studs.
Lift the frame into place on top of the sill plates with an assistant's help. Nail the frame to the sill plates, and attach it to the studs in the intersecting walls and the ceiling with drywall screws.
Cut two 2-by-4s that are the same height as the door, and nail them to the end studs in the doorway. These studs are called the jack studs, and the end studs are called the king studs.
Cut the header for the doorway from a 2-by-4. The header is the same length as the distance between the two king studs.
Nail the header to the top of the jack studs. Nail a stud between the header and top plate. This is called the cripple stud. If there is more than 16 inches between the cripple stud and the king studs, use multiple cripple studs.
Measure and cut drywall sheets to fit on the wall. Attach them to the framing with drywall screws every 16 inches.
Staple flexible corner beads to the edges of the doorway, using one staple every 3 inches.
Apply joint compound to the joints between the sheets of drywall and over the corner beads with a putty knife. Place drywall tape over the joint compound, and run the putty knife over the tape to press it into the joint compound. Allow it to dry overnight.
Sand the joints with fine-grit sandpaper, and wipe the dust off the wall with a clean, dry rag. Add two more applications of joint compound and drywall tape, allowing each coat to dry overnight and sanding it smooth.
Coat the walls with latex-based primer and allow it to dry.
Paint the walls with two coats of paint, allowing each coat to dry.
Nail molding to the base of the wall with finishing nails.