Garlic is a strong deterrent for many garden pests and it can also kill a variety of pests. To make a garlic spray, crush a couple of cloves of garlic (make sure it's organic), put it in a small jar and fill with water (something around 200 - 250 mL is desirable). Allow it infuse overnight at room temperature. Filter it in the morning and dilute the resulting liquid to obtain 500 mL of liquid. If you're using it as a deterrent, add a couple of drops of detergent as this will help it 'stick' to plant foliage.
This will deter most pests and can kill a range of bugs and soft bodied insects - sap suckers in particular don't like this. You'll have to reapply regularly if it's used as a deterrent, especially after watering or if it rains. Garlic infusions will also harm beneficial insects if sprayed directly on them. Most beneficial insects aren't deterred by it though.