Rear view mirror buttons can generally be removed by pushing a screwdriver into the latch and twisting, although some might require unscrewing with an Allen key. Depending on the complexity and location of the mirror assembly, it may also be necessary to detach trim and disconnect electronic circuitry before removing the rear view mirror button.
Once the button has been removed, it is extremely useful to mark (either with a pen or a by scratching with a sharp object) its "right side up." This makes replacing the button far easier.
It is also wise to mark the position of the button on the windshield (on the outside) with a piece of tape, pen, grease or pencil.
Before it comes to replacing the button to the windshield, both the button and its location on the inside of the windshield should be cleaned. This is why the button's location marker is best placed on the outside of the windshield. All glue should be removed from the button, as well as from the glass, with sandpaper, a razor blade and rubbing alcohol or lacquer thinner.
New glue can then be applied to the button before positioning it precisely and holding it against the windshield for a minute or so. The mirror assembly can then be reattached.