As the global population ages, cognitive impairment (CI) becomes more prevalent. Tea has been one of the most popular drinks in the world. Several studies have demonstrated that tea consumption has an impact on cognitive function. This study aims to examine the association between tea consumption and cognitive function and explore the potential effect of genetics on the relationship between tea consumption and CI risk in older adults. This is a prospective longitudinal study using data from the Chinese Longitudinal Healthy Longevity Survey (CLHLS). Six waves of data from CLHLS containing 76,270 subjects were analyzed. Generalized estimation equations (GEE) with a logit link function were adopted to estimate the effect of tea consumption on CI risk from a cross-sectional and longitudinal perspective. A population-based cohort of adults aged 65-105 years. The frequency and type of tea consumption were obtained by questionnaires. CI was measured based on MMSE. Polygenic risk was measured using the polygenic score approach described by the International Schizophrenia. The results showed that drinking green tea had a better protective effect on cognitive function than other types of tea, the incidence of CI gradually decreased with the increase of tea consumption frequency, and men were more likely to benefit from tea consumption. Additionally, we also found a significant interaction between tea consumption and genetic risk, measured by polygenic risk score (PRS). Based on current research evidence, tea consumption, may be a simple and important measure for CI prevention.