Keeping dogs and cats out of flower beds is best done by keeping them away from the area altogether through the use of fences or separators. Make sure pets don't trample the garden with tips from an experienced pet trainer in this free video on dog training and behavior.
How to keep your dog and cat out of the flower bed? This is another good one to manage. It's hard for your to always be there to keep your dog or your cat from getting in to something you don't want them to get into so it's not a bad idea to keep them out of the area all together. That's a little bit harder to do with cats that are outside and your neighbors might have cats that you want to keep out of your flower bed as well. So, sometimes there are other efforts, other things that can be done that won't act on your behalf when you're not there. During the summer some things cats find very aggressive and dogs, too, when they're surprised by it is to look at some kind of a sprinkler to an eye so that when it sees movement, it just shoots out a little bit of water and frightens that animal out of the way. Another thing is they are some sense that these animals that don't like, they can be sprayed around there that will discourage them from getting involved in that area. But in the end, the best bet especially with dogs is to make sure that your plantings are in a safe place that's protected from your dog on a regular basis when your dog does not have your supervision. Put up a fence, have your dog in a separate part of the yard or better yet, keep your dog inside and let them out in the yard when you can supervise.