Find your local channels (and where they come from)
A free website called AntennaWeb can tell you a lot about what antenna you'll need. Just plug in your zip code and it will provide you with a list of channels, the strength of antenna they require and a map showing where those broadcasts are coming from. For example, here's what AntennaWeb returns for where I live in San Diego:
You'll notice that all the channels come from different directions and have different signal strengths (as noted by their colors).
For contrast, here's where I used to live in Los Angeles:
Here, almost all the channels came from one direction, so it'd be best served by a different antenna than the San Diego location. And unfortunately, if you live in a rural area, you may not find that you have any channels available at all.
Pick the right kind of antenna
From the AntennaWeb list, pick the channels that are important to you and note their colors and where they come from.
Armed with that information, you can start searching for antennas. You'll want to consider a few things.
Size and range. Yellow and green channels on that list should work with smaller antennas while red and blue channels may need something bigger and more powerful. You can also note the distance of each channel from your location and compare it to the range offered by the antenna (though the antenna's range is probably lower than the specs state, thanks to buildings and other obstructions -- so always overestimate how much range you'll need).
Indoor vs. outdoor. If you're close to the broadcast towers in your area -- 20 miles or less -- and don't have too many obstructions, you may be able to get by with an indoor antenna that mounts to the wall near your TV. Here are the Wirecutter's picks for the best indoor antennas to get you started.
Directional vs. multi-directional. If you're in a city, you'll probably get more channels with an antenna that can receive signals from multiple directions, known as a multi-directional or omni-directional antenna. However, directional antennas tend to be more powerful and can grab stations from farther away -- as long as all the channels you're interested in come from one direction (which is likely if you're in the suburbs). 1byone makes both directional and multi-directional outdoor antennas that work well in my experience.
Amplified. You can get a signal from your antenna by plugging it directly into your TV, but many antennas also come with amplifiers. Amplifiers plug the antenna into a wall outlet, boosting its signal so they can reach farther. This can be good if you're far away from all of your stations (or if you have to use a coaxial cable longer than 50 feet), but it can also cause problems. The amplified version will usually cost a tad more, but it's worth trying if the non-amplified version isn't getting the stations you want.
You shouldn't have to spend too much to find a good antenna. Most of these categories should have options between $20 and $60, with amplified versions on the higher end of that range.
Once you find an antenna with the right combination of features, you're ready to try it out.
Exchange it if you don't get the channels you want
The unfortunate reality of TV antennas is that it's difficult to know which models will work for your specific location. Beyond all of the above characteristics, buildings, trees and terrain can make a big difference. The best way to find the right antenna is to test it yourself.
So when you buy an antenna, buy from a store with a good return policy -- preferably one without a hefty restocking fee -- and try it out at home. If you have an indoor antenna, place it as high up as you can, near a window if you can, and on the side of the house facing the most broadcast towers. If you can mount a larger antenna in the attic or on the roof instead of on the living room wall, all the better. It'll take a bit more work, but you're basically guaranteed better reception.
Once you've mounted the antenna, plug it into the coaxial port on your TV, open your TV's menu and find the option to scan for over-the-air channels. Once the process is finished, you can see which channels your antenna was able to find and how good of a signal they have. If you aren't getting as good a signal as you'd hoped, try moving or repositioning the antenna or plugging in an amplifier (if it came with one). If that still doesn't work, you may have to try something bigger or more powerful. After a little trial and error, you should find the perfect antenna and positioning, and you can enjoy your free, over-the-air HD channels.