The mirror is held in place with a single setscrew. Loosen the screw and lift the mirror off. Don't forget to unplug the electrical connector if the truck has an electric Day/Night mirror.
Repair kits for damaged mirrors are available and most auto parts stores. The most important part of the repair is the beginning. Mark the outside of the windshield to locate the pad, then scrape the old adhesive off with a razor blade. Clean the remaining adhesive off with chlorine-based window cleaner (not petroleum-based solvent) as thoroughly as possible. Follow the manufacturers instructions exactly to complete the repair.