Locate the studs surrounding the cabinet opening with a stud finder and mark their edges with tape or a pencil. As you scan the surrounding wall with your handheld stud finder, it notifies you whenever it detects a dense object behind the section of wall, which usually corresponds to a framing stud.
Cut a 2-inch by 4-inch block of lumber to fit the base of the opening for the cabinet. Secure the two-by-four by inserting four #6 by 2-inch flathead screws through the block into the drywall. Insert two additional #6 by 2-inch flathead screws into the nearby studs at an angle.
Cut 4 1/2-inch thick lumber boards to match the dimensions in your cabinet assembly drawing for the cabinet's top, bottom and sides. Size the length of the bottom board to be 1/4-inch less than the wall opening.
Assemble the cabinet's rectangular frame by applying wood glue and screwing the top, bottom and side boards together with eight #6 by 2-inch flathead screws. Drill 1/4-inch holes for any adjustable shelves, four inches from the top and bottom boards, three-quarter inches from the edges and two inches vertically from each other.
Nail a 1/4-inch thick plywood board onto the back of the frame with 1/2-inch brads. Brads are less likely than normal nails to split the frame's softwood.
Nail and glue a face frame onto the front of the cabinet with 1 1/4-inch brads, leaving a 1/4-inch reveal on the frame edges.
Screw the two door hinges into the inner part of the face frame, near the frame's top and bottom. Attach the cabinet door by screwing the other side of the door hinges into the 1/4-inch thick plywood door. Center and screw the door handle onto the opposite side of the door.
Apply construction adhesive onto the 2-inch by 4-inch block and the back edges of the face frame.
Slide the cabinet assembly into the wall opening and center it. Fill in any remaining gaps with putty matching the wall's color. If necessary, secure the cabinet by driving finishing nails through the face frame into the studs.