At first glance, modifying weapons and/or armors in Mass Effect Andromeda might seem relatively simple, however there are several rules to that. To even think about modifying your equipment by placing special mod items inside of it, you first need to find weapons and/or armors with appropriate number of sockets in them. Each weapon (aside from the melee ones) has 2 sockets. Unfortunately, pieces of armor are quite different - only the torso armor has a single socket place for a very unique Fusion Mod. Fusion Mods description can be found in a separate chapter.
When you've acquired a desired weapon and/or piece of armor, as well as a mod, you just have to enter the loadout screen (it appears each time you leave the Tempest ship, it can also accessed from the Tempest and by Forward Stations on the surface of the planets), select the weapon/armor you want and press the button shown on the screen to open the mod screen. You then have to accept your selection (and, if you want, add more mods to free sockets) and leave the loadout screen. Don't forget to equip the weapon you've just modified!
There's a single limitation associated with item modifications - you can't install two mods of the same type on a single weapon / piece of armor. You won't be able to, for instance, install two scopes on a sniper rifle. It forces some limitations on the player but given the amount of different weapon / armor mods available in the game you shouldn't have problems finding something that will suit you just fine.
Note - the amount of sockets available on an item can be increased by using Augmentations, special items that can be installed on an item during its creation. You can find more on that in the chapter about crafting items.