Enter the inventory by pressing the [TAB] or [I] key. Drag the desired item to the slot where it says [Ground] and drop. This will allow your character to drop the item on the ground.
Weapons can also be dropped and when dropped, the attachments will also be dropped.
If you re-acquire the dropped weapon, attachments will come attached on the gun.
In duo or squad modes, you can drop the items so that your teammate can acquire them.