Birds are repulsed by the feel of the foil beneath their beaks and will avoid it. You can hang strips of aluminum foil (or gleaming party streamers) from trees or other prominent locations throughout your home and garden.
The sun reflects off the gleaming surface and irritates their eyes, discouraging them from approaching.