You need to open the inventory with the Tab key.
Then select the weapon by hovering over it and press the E key. You'll see the "Equip" option. Congratulations! The weapon is now equipped. To use it, simply hold down the right mouse button to aim and left-click to attack.