Empty out the inside of the cabinet and remove the shelves. For many models, you can grab the front of the shelves and slide them out.
Remove the screws from the inside panels of the cabinet with a screwdriver or drill. Turn the screws counterclockwise until they come out of the wall anchor and cabinet. An anchor is a plastic piece that sits inside the wall to support the screw. The number of screws will depend on the model of medicine cabinet. Look for at least two on each side.
Close the cabinet door and slide your fingers between the wall and back of the unit. Pull the medicine cabinet out toward you to remove it.
Insert the new cabinet into the recessed area. Line up the holes in the replacement unit with the holes already in the wall. If necessary, drill new holes using the replacement as your guide. Slide a drill bit through the hole in the cabinet to create a new one in the wall. Remove the cabinet and push a wall anchor into the newly made wall hole.
Push the replacement into the wall and secure it with the screws. Slide a screw through the hole in the medicine cabinet into the wall anchor and turn it clockwise with the screwdriver or drill. Repeat the process until all the screws are in place.