Measure the distance from the back wall to the location of the new wall you're building. Using a stud finder, locate the studs in the side walls and mark them. You will nail the framing of the new wall into the studs.
Measure and cut two pressure-treated 2-by-4 boards to be the sill plates. The sill plates connect the frame to the floor. Cut the sill plates long enough to leave a space between them that is wide enough for the door.
Remove the molding from the base of the adjoining walls where you're installing the new wall by cutting through the molding with a reciprocating saw and prying it off with a pry bar.
Lay the sill plates into position on the floor, placing one end of each board butted against the wall where you removed the molding.
Cut through the carpeting along the edges of the sill plates with a utility knife. Remove the sill plates, then lift the strips of carpet off of the floor. Cut through the padding underneath the carpet, and remove it until the subfloor is exposed.
Lay the sill plates back into position, and screw them to the floor every 6 inches. Use masonry screws for a concrete subfloor, and galvanized screws for a wooden subfloor.
Measure and cut a bottom plate for the frame for each sill plate, and a top plate that is the length of the entire wall, using untreated 2-by-4 boards.
Lay the top plate on the sill plates, and place one of the bottom plates on top of the top plate. Measure the distance between the boards and the ceiling. This is the length for the studs.
Measure and cut untreated 2-by-4 boards for the studs. Cut enough studs so that you can space them no more than 16 inches apart.
Assemble one side of the wall by nailing a stud into each end of one of the bottom plates. Nail more studs between the end studs, keeping them spaced 16 inches apart, at most. Assemble the other section of the wall using the same process.
Nail one section of the wall to the top plate by aligning one of the end studs with the end of the top plate and driving nails through the top plate and into the studs. Repeat this with the other wall section.
Lift the framing into place onto the sill plates. Nail the end studs to the adjoining walls, the bottom plates to the sill plates and the top plate to the ceiling.
Cut a 2-by-4 board that is long enough to fit between the two end studs in the doorway. (These studs are also called the king studs.) This board will be the header for the doorway.
Nail the header to the king studs at the correct height for the doorway.
Measure and cut two 2-by-4 boards to fit between the header and the floor. Nail one board to the outer edge of each king stud. These boards are called the jack studs.
Cut and install 2-by-4 boards to be the cripple studs. These studs run between the top of the header and the top plate. Most doorways need only one cripple stud, but cut multiple cripple studs if there are more than 16 inches between the cripple stud and the king studs. When nailing the cripple stud to the top plate, drive the nails through the cripple stud and into the top plate at a 45-degree angle.