The two main things to keep in mind when deciding where to place your bird feeder are: can you see the feeder well, and is the feeder in a safe location. The first of these is easy, but the second takes a bit more planning. You’ll want to make sure the feeder is in a place that’s relatively safe from window collisions and from predators.

Perhaps counterintuitively, feeders are safest when they’re closest to windows—because if a bird takes off from the feeder and hits the window, it won’t be going at top speed.

Feeders close to natural shelter such as trees or shrubs offer resting places for birds between feeding bouts and a quick refuge if a hawk flies through

You can provide resting and escape cover for ground-dwelling birds such as Song Sparrows and White-throated Sparrows by providing loosely stacked brush piles near your feeders.

Hummingbird feeders should be placed where they are protected from wind; a swaying feeder may spill sugar solution. Also, try setting them where they are mostly shaded, because sugar solution spoils quickly in the sun.
Source: Where To Put Your Bird Feeder | The Cornell Lab

Click on image to go to source.
 


Where to Put Bird Feeders: Spread Them Out! | BirdSeedandBinoculars.com


 
Feders at my New Jersey House which worked after several iterations of squirrel-proofing.
Squirrels both climbed the pole and jumped from the nearby shrub.


Things to attract birds:

Plants to attract birds:
Nectar producing plants attract pollinators (hummingbirds, bees).
See Plants for hummingbirds

Barberry (Berberis) - Songbirds, sparrows
Forsythia - Sparrows, robins, cardinals
Honeysuckle (Lonicera) - Catbirds, robins, wood thrushes
Rose (Rosa) - Catbirds, cardinals, thrashers, sparrows
Protection: Juniper, Honeysuckle, Spruce, Yew, Hemlock, ...
Source; How To Attract Birds To Your Yard | Stauffers

Links:
Squirrels
Where To Put Your Bird Feeder | The Cornell Lab
Choosing a Bird Feeder | NY Audubon
FeederWatch
8 Common Bird Feeder Mistakes You Might Be Making (And How to Fix Them) | Better Homes & Gardens
How To Attract Birds To Your Yard In 9 Steps