Dementia is a multifactorial syndrome attributable to a combination of vascular risk factors, lifestyle factors and neurodegeneration. However, little is known about the relative contribution of all these factors and their combined effects on cognition among the older population. To examine the association of four domains of risk factors (sociodemographic, vascular risk factors, neuroimaging markers, lifestyle and psychosocial factors) with cognition in older adults. A cross-sectional study. Data was obtained from a large-scale population-based study, UK Biobank study, at the first imaging visit assessment. Participants are citizen or permanent residents of UK, aged 60 years old and above. Cognitive function was assessed using the general cognitive ability score (g-factor score) derived from principal components analysis estimates of six cognitive tests. Associations with cognition were examined using multivariable linear regression for each domain and in combination. The study included 19,773 participants (mean age 68.5 ± 5.3 years SD, 9,726 (49%) male). Participants with lower cognitive scores (poorer cognition) were older, female, non-whites individuals, less educated and more socially deprived than participants with better cognitive scores. Participants with lower cognitive scores also tended to have higher vascular risk factors, lower brain volumes and more adverse lifestyle behaviours. The multivariable analysis found associations between adverse lifestyle and psychosocial factors with poorer cognition, i.e., being obese by measure of body fat percentage, having diabetes, higher white matter hyperintensity volume, increased sedentary screen time watching TV, being socially isolated and having depression were independently associated with poorer cognition. While larger hippocampal volume, having optimal sleep duration, adherence to a heathy diet, current and former alcohol drinking, increased wine consumption and sedentary screen time using a computer were associated with better cognition. A combination of adverse lifestyle and psychosocial factors were independently associated with poorer cognition in older adults. Findings in this study can potentially support public health communications to promote cognitive function and independence among older adults. This research has been conducted using the UK Biobank Resource under Application Number 71022.