The three main pests in my urban garden are rats, insects, and neighbours. :)
The first two years I grew food I killed almost 20 rats. The rats are not going anywhere so I had to change what I grow:
- I hang the strawberries
- I grow tall peas now instead of short ones
- I no longer grow carrots or beats
- I spread chili powder around the tomatoes
For insects:
- Raised garden beds to reduce slugs
- Flowers that attract aphids to attract lady bugs
- Umbellifer flowers to attract beneficial wasps
For neighbours, I haven't done anything yet. I may net the fruit trees.