This is a pretty comprehensive guide for EV training: https://www.serebii.net/games/evs.shtml
In summary, though, all EVs start at 0 when a Pokémon is first generated. EVs are gained through battling Pokémon like EXP. Each Pokémon gives a small number of EVs in some stats depending on the species (for example, Aron gives 1 Def EV, while Lucario gives 1 Atk EV and 1 Sp.Atk EV). Every 4 EVs gained in a stat increases the final stat by 1 point when at level 100. Each stat can have a maximum of 252 EVs (for 63 more points), and the total EVs for a Pokémon maxes out at 510, allowing you to max out two stats with 6 EVs left over.
There are some things that can make EV training easier. Vitamins give 10 EVs in their corresponding stat if there are less than 100 EVs in that stat. A Pokémon that has Pokérus (or had it at one point) will double all EVs gained through battle (doesn't affect vitamins). The Power items give 8 more EVs in their corresponding stat every time the Pokémon holding it gains EVs in battle (Pokérus doubles this to 16). There are a few others, but those are the most important.
EVs are completely hidden from the player in most games, but in SM/USUM, you can view a graph of your Pokémon's EVs in their summary screen by pressing Y. First, there's a yellow graph, which is the base stats of the Pokémon, and then extending from that is either a blue graph (if you've maxed out all 510 EVs) or an orange graph (if you have not). This won't give you exact values, but you'll be able to see if you accidentally got some EVs in the wrong stat, which you can fix with one of the EV-reducing berries.
IVs are set values between 0 and 31 that are generated along with the Pokémon and normally cannot be changed. In Gen 7, a level 100 Pokémon can have its IVs maxed out by giving a Bottlecap to Mr. Hyper in Hau'oli City. Each IV increases the corresponding stat by 1 point at level 100.
To check the IVs of your Pokémon, you first have to become the champion and reach the Battle Tree. There will be someone standing next to the PC who will give your PC the "Judge" option if you've hatched at least 30 eggs. You can then toggle IV view on the PC. This video demonstrates how to do it.