Where grass is concerned, the winner takes all, and if you're installing a garden in the middle of the lawn, expect hand-to-blade combat. It's the eternal homeowner's struggle: You want thick, lush grass, but you don't want it in the flowerbed, yet the grass keeps trying to get in.
Your best bet is to begin at the beginning
How Grass Spreads
The reason people love turf grass is its tenacious urge to spread and the rhizomes that make that possible. Many cool-season grasses have a kind of roots called rhizomes. These underground runners are tough cookies, crashing through soft soil and hard soil. They root themselves and start new grass plants that also wander through rhizomes and continue to take over the yard. Some grasses can resprout from a tiny piece of rhizome left in the soil. These are the grasses that invade your flower garden.
Start at the Beginning
The best time to take a stand against the grass that wants to take over your flower garden is when you carve out the garden in the first place or when you begin a garden renovation.
Use a lawn cutter or a sharp spade to cut into the grass along the border where the lawn and garden are to meet. Make vertical cuts into the sod, and take care not to leave any rhizomes on the garden side of the border.
Till the area thoroughly until it is entirely loose and loamy. Use your hands to sift through the soil to remove every trace of root and rhizome you can find. Take your time and pull out every last piece. Starting grass-free is the key to maintaining a grass-free garden.
Look for grass and weeds the next growing season and pull them up by hand. These are the plants that grew from seeds in the soil. Weed promptly and diligently to get them all.
Apply a 2-to 3-inch layer of organic mulch around the flowers, once they are planted. Keep the mulch a few inches from the plant stems, but otherwise, mulch over every square inch of bare soil.
If you have an existing perennial garden or shrubbery line invaded by grass, you have only a few choices. You can attempt to dig out the grass rhizomes and roots by working the soil between existing plants, but this plan has obvious flaws and can not be expected to clear out most or all of the grass. Persistence will eventually pay off, but it could take several years. Weedkillers are a poor choice because they tend to also kill the plants in the area.
To truly eradicate the grass and have a chance at keeping it out, you'll have to take out all existing plants and use a rototiller, starting the garden again from scratch.
Using Barriers and Edging
It's a good idea to install edging between grass and garden. You'll find many plastic and metal products at the garden center, with black plastic edging being the low-cost option. These are generally more effective than barriers made from bricks and gardening fabric, because grass eventually finds a way through every opening. To install these you generally dig a trench at least 8 to 10 inches deep and secure them with stakes.