How do you change out / remove attachments?

This game has attachments on your guns, but I’ve been spending ALOT of time trying to remove and switch parts. How in the world is that done? I can’t figure it out.

As far as I am aware you cant switch them out, Its apparently there as a view to see what parts of the guns are supplying what stats. (stuff like when people look for “God Rolls”) you can see what parts of the gun are Legendary ect.