When a zombie appears, plant a Potato Mine. Plant an Iceberg Lettuce to get more sun if needed.
Do not forget to build your offense; Some Bloomerangs in front of the planks and some Bonk Choys at plankless rows. You'll also need Wall-nuts and Spikeweeds. Replace eaten Wall-nuts will new Wall-nuts and Sunflowers with Bloomerangs. Plant Spikeweeds on planks to damage barrels and many zombies at the same time.