Understanding how psychosocial factors can promote better cognition in mid- and later life is important for making recommendations regarding policies and intervention programmes. This study focuses on two psychosocial aspects (social connectedness and social engagement) in order to assess their independent contribution to explaining cognition, but also how their interrelationship acts on cognition. We hypothesised that each of the factors is positively associated with cognition, but also that a combination of both factors contributes more to cognition than each of the factors independently. Our sample comprises 66,504 individuals who participated in the Survey of Health, Ageing and Retirement in Europe (SHARE). Multilevel linear regression analyses were performed. The results show that higher levels of social engagement and social connectedness are associated with improved cognition. When studying the interaction of social engagement and social connectedness and its association with cognitive function, the analysis shows that better cognitive scores are found in individuals having high levels of both social engagement and social connectedness. Moreover, when one of these aspects is lacking, the other plays a role in cognition protection. This study indicates the importance of social connectedness and social engagement for preserving/developing cognition, which greatly contributes to the quality of life of middle-aged and older adults.