The short answer
Hang your feeder in partial shade, near trees or shrubs where birds can escape quickly, and where you can see it easily. Keep it out of direct sun. Place it either close to a window or well away from one, to lower the risk of collisions. If you have several feeders, put them out of sight of one another.
Choose partial shade
Direct sun heats the nectar and makes it spoil faster. A spot that gets morning sun and afternoon shade often works well.
Stay near cover, but not too close
Hummingbirds like to feed near places where they can rest and hide. Hang the feeder near shrubs or trees so they can dart in and out and perch nearby. Avoid spots where a cat can hide close enough to pounce. How to keep cats away from backyard birds covers that problem.
Keep branches from touching the feeder or its hanger. Branches give ants and other insects an easy route in. How to keep ants off hummingbird feeders explains more.
Keep feeders away from windows
Hummingbirds can build up speed on the way to a feeder, and a nearby window can injure them. Many bird groups suggest hanging a feeder either within about 3 feet of a window, where birds have less room to build speed, or more than about 30 feet away.
Window reflections cause trouble too. Some birds fight their own reflections, which is explained in why do birds attack their reflection in windows. For wider window safety, see how to stop birds hitting windows.
Space out multiple feeders
Hummingbirds defend food, and males are especially territorial. A second feeder within sight of the first can start chases. If you hang more than one feeder, put them out of sight of each other. Why do birds defend their territory explains the behavior.
Choose a sturdy hanger
Use a hook or hanger that holds the feeder steady in wind and that you can reach easily. Hang the feeder at a height where you can fill and clean it without strain, which is often about eye level. Being able to see it from a chair or a window helps you notice spoiled nectar and new visitors.
The same ideas apply to seed feeders. See where to place a bird feeder for those.
If birds ignore the feeder
Give it time, and make sure the nectar is fresh. If no birds come after several weeks, try moving the feeder closer to flowers or cover, or to a spot you can see from a window.