Each plant or zombie species has specific talents which have their own strengths and weaknesses. There are many lawn configurations players can create to ward off the undead legions, but really there is no truly 'perfect' defense. Some layouts perform significantly better than others, with many of the endless modes requiring the use of cob cannons to cope with the massive zombie onslaught.
You can comfortably play through the regular story mode using a wide array of unique lawn artillery. I'm listing a few of my personally preferred weapons here, keeping in mind that they may not be the best layouts for certain areas in the game.
Firstly, a ranked list of all my favourite plants:
1. Spikeweed + Spikerock
They are inedible and hurt things just by being there.
2. Repeater + Gatling Pea (+ Torchwood)
Saves valuable real estate. Gets even better if upgraded to fireballs.
3. Tall-Nut + Pumpkin
Stalling for time is their game.
Lane diversion for more time and Sunflower space.
5. Melon-Pult + Winter Melon
Smashes zombie heads, and slows the surviving ones down.
6. Fume-Shroom + Gloom-Shroom (+ Coffee Bean + Pumpkin)
Very useful for when those unconventional zombies roam close to your door. Also works well in pool lanes.
Shoots everything, although you'd need a lot of them to target the right zombies.
Secondly, a ranked list of the most annoying and dangerous zombies:
These are huge and crush everything with their bulk. Also, they throw smaller imps at your house door.
2. Zomboni (+ Zombie Bobsled Team)
They run over everything and leave behind a barren ice slick.
3. Football Zombies
They run fast and eat fast.
4. Ladder Zombies
The ladders allow other zombies to climb over your plants and into your house.
5. Balloon Zombies
They'll float over your plants and straight to your brains.
6. Catapult Zombies
Basketballs will be launched at your most vulnerable plants.
7. Bungee Zombies
In yo lawn, stealin' yo plants.
8. Pole Vaulting + Zombie Rider + Pogo + Snorkel Zombies
They all jump over your first line of defense, and beyond.
Examples of some of the lawn configurations I've used: