Hold the medicine cabinet against the wall in the exact location where you wish to install it. Have an assistant trace around the perimeter of the medicine cabinet where it touches the wall.
Mark the location of any studs that sit in the area you traced, using a stud finder to locate the studs. Cut a small hole within the area you trace, using the drywall knife. Shine a flashlight into the wall through the hole to look for the presence of plumbing, wires or other obstructions, all of which may require you to relocate the medicine cabinet.
Cut through the wall along the line you traced, using the drywall knife. With a handsaw cut through the wall stud along the tracing, if one is located where you traced the medicine cabinet.
Measure the dimensions of the wall cutout and cut 2-by-4s to fit along the perimeter of the cutout, using the circular saw. Spread construction adhesive onto the boards where they will contact the inside of the wall and the trimmed wall stud. Insert the cut boards into the cutout, sliding them under the drywall at the edges of the cutout.
Drive screws through the wall at the edges of the perimeter, anchoring the screws into the boards to hold them in place. Drive screws through the ends of the boards that touch the cut wall stud, angling the screws so they anchor into the wall stud as well.
Slide the medicine cabinet into the cutout in the wall. Open the cabinet's door and drive wood screws through the sides, top and bottom of the cabinet and into the boards you anchored inside the wall.