The procedure for disassembling a gun varies by model. If you haven’t done this before, follow the instructions provided in the manual or watch instructional videos online. Take pictures throughout the process so that you can refer to them when reassembling the gun. The best way to sand the parts is to use a sandblaster to remove the existing paint or coating from the metal. Use 120-grit aluminum oxide blasting media. If you can’t access a sandblaster, rough up the surface of the existing paint with sandpaper. This process preps the pieces so the new paint will adhere evenly. You can rent a sandblaster from your local home improvement store. You need an aerosol degreasing agent that dries without residue, like Brakleen or TruStrip Solvent. Put on gloves, a long-sleeved shirt, and eye protection, such as a face shield. Be sure you are working in a well-ventilated area. Spray each metal part with the degreasing agent and wipe it down with a clean, lint-free cloth.  Clean plastic pieces with 91% isopropyl alcohol instead of the aerosol degreasing agent.  Use clean gloves to handle the clean parts as oils from your fingers will mar the surface and prevent the paint from adhering properly. Use masking tape to cover all moving parts as well as any areas that you don’t want painted, like the trigger and trigger guard. Use modeling clay or foam ear plugs to plug holes in parts like the barrel so paint won’t pool inside them.

Summary:
Disassemble the gun if you only want to paint certain parts. Sand the parts you want to paint. Clean metal parts with an aerosol degreasing agent. Mask any areas you don’t want coated and plug all holes.