Look for a bright yellow finish to the nut, true halves, not splits, and not a lot of grit or grime or bark in the bottom of the bag. Mostly, though, look for the color. If they're rancid, they'll discolor. Once you get them, use them right away. Or freeze them, shelled or not.
Shelled pecans can keep six months in the freezer.
Pecans, unfortunately, aren't cheap. With a pound or so of pecan halves in the freezer, you're ready. For the simplest, just toss nuts with melted butter and sprinkle with salt, or seasoned salt, before roasting. For sweet versions, toss the nuts with beaten egg white, then shake in a bag with sugar and a flavoring like grated orange zest. The only trick is to keep the nuts from burning.