You Have to Put in The Work
One thing that’s easy to forget is that you don’t earn any XP if you don’t actually do anything. Unlike most games that give you XP for being in the game or being on the winning team, PvZ: Garden Warfare 2 will not do that. If you want to level up, you’re going to have to put in some work. That means you’ll need to be shooting, healing, defending, reviving, capturing, and taking over everything on your own. Also, you only earn XP for characters you are directly in control of.
Playing offline allows you to summon your other characters to play as your friends. You can swap between them at any time, but you’ll only earn XP for the particular character you’re controlling at that time. Be aggressive and lead your team in order to reap the maximum rewards.
Get shots on every enemy so you can at least earn XP for assisting, heal allies even if they’re missing only a sliver of health, plant assistance in pots, and cover all objectives. That will ensure that you make the most out of your grind.