The first thing to do is identify the animal or rodent that is causing the damage, that way you can figure out the best deterrent. Is the creature attracted to a certain food source in your yard? Maybe certain plants or shrubs are drawing it. If this is the case, you may have to remove those types of plants or shrubs. You could also try a barrier specifically designed to keep out wildlife. Or instead of a chemical repellent, try a noise that the creature is frightened by or even a visual deterrent.
Although this shouldn’t be your first option, capturing the animal and then relocation it is another thing you could try. If you do decide to do this, however, it is advisable to contact your local animal control or wildlife agent who can tell you the best course of action. Lastly, after weighing up all the options, you might just decide that the animal isn’t all that bad and the best thing to do is nothing at all.