Basically it boils down to damaging zeds with perk weapons (or any weapon if you are playing as survivalist)
The secondary xp objectives only count for tiny amounts of xp, like killing a crawler as gunslinger yields 10xp
(on hard or suicidal, can't remember), with a headshot kill being a measly 11xp
This being said, doesn't mean you shouldn't weld doors/heal/go for headshots, but don't make it your objective.
The best way to get XP is to have fun with your friends, preferably in long games. Difficulty I would recommend is hard, suicidal if you're feeling confident (the difficulty difference from hard->suicidal->HOE is very high, while the xp gain difference is very little)