Upgrading barrels, sights, and stocks for your weapons to make them more effective is done by crafting the materials you get from diassembling other weapons you have in your arsenal or the weapons you pick up after a firefight from fallen enemies.
Follow the steps below to dismantle a weapon
Step 1:
Approach the weapon you want to dismount.
Step 2:
Press a button according to the console you are using: PlayStation 4 (Circle), PC (R) and Xbox One (B).
Step 3:
If you keep the button held down for a few seconds near the weapon you want to dismantle you will get your materials. If you are playing any difficulty below Hardcore Ranger a counter will appear to let you know how long you need to hold the button down for. On Hardcore Ranger no instructions will appear on screen and you will have to keep holding down the button corresponding to your console until you have collected the waste materials.