Cognition is defined as the processes by which animals collect, retain and use information from their environment to guide their behaviour. Thus cognition is essential in a wide range of behaviours, including foraging, avoiding predators and mating. Despite this pivotal role, the evolutionary processes shaping variation in cognitive performance among individuals in wild populations remain very poorly understood. Selection experiments in captivity suggest that cognitive traits can have substantial heritability and can undergo rapid evolution. However only a handful of studies have attempted to explore how cognition influences life-history variation and fitness in the wild, and direct evidence for the action of natural or sexual selection on cognition is still lacking, reasons for which are diverse. Here we review the current literature with a view to: (i) highlighting the key practical and conceptual challenges faced by the field; (ii) describing how to define and measure cognitive traits in natural populations, and suggesting which species, populations and cognitive traits might be examined to greatest effect; emphasis is placed on selecting traits that are linked to functional behaviour; (iii) discussing how to deal with confounding factors such as personality and motivation in field as well as captive studies; (iv) describing how to measure and interpret relationships between cognitive performance, functional behaviour and fitness, offering some suggestions as to when and what kind of selection might be predicted; and (v) showing how an evolutionary ecological framework, more generally, along with innovative technologies has the potential to revolutionise the study of cognition in the wild. We conclude that the evolutionary ecology of cognition in wild populations is a rapidly expanding interdisciplinary field providing many opportunities for advancing the understanding of how cognitive abilities have evolved.