The best way to grind XP is to capture multiple low-level Pokemon, pay attention to the number of candy they require to evolve, and wait until you have enough Candy for multiple evolutions at the same time. By capturing the same type of Pokémon over and over you gain more Stardust and Candy. So, don’t think ill of all those Doduos, Caterpies, and Weedles! They’re potentially useful because you can transfer duplicates, which will earn you 1 candy of that Pokemon type. Then, use a Lucky Egg and evolve all of the Pokemon at the same time to gain double the amount of XP. Pidgeys are especially pretty good for this.
Some words of wisdom on Stardust and Candy, though: think carefully about what Pokemon you want to power up now, and which ones you want to save for after you evolve. The more you power up a Pokemon you eventually plan on evolving, the longer it’ll take you to collect the 25, 50, or 100 candies you need to evolve that little guy and see the Pokemon’s CP skyrocket anyway. Pro tip: evolve the Pokemon first, then power it up. Better to use your stardust on Pokemon that are finished evolving or only have one form to optimize your battle lineup, with a bunch of even stronger Pokemon waiting in the wings, piling up candies to take your squad to the next level once they evolve.