there are a lot of post that regarding to the EV training guide n location.
For me, once u defeat a Pokemon, u will receive that Pokemon EV. which Pokemon give u which EV, u can refer here
https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_effort_value_yield
there is a limit for the EV value, so better get a plan in which Pokemon you gonna to fight with or not to fight with.
Eg. For the Pokemon you wish to boost its Attack, just defeat the Pokemon that provide Atk EV, when meet others Pokemon, dun swap the Pokemon, just run.